Policemen off-duty are obligated (by honor, sometimes also by contract) to immediately put themselves on-duty if situation demands. This was one such case, though it doesn't have to be anywhere near as extreme. It's the same principle as with doctors, firemen and other emergency services. Being off-duty does not mean you're allowed to ignore problems you're able to and paid to solve.
As a result off-duty police are allowed to carry guns 24/7 in most jurisdictions, regardless of gun carrying laws.
McHrozni
Like I said that requires us to allow citizens to carry guns. Otherwise we'd have to have many accessible repositories of firearms for whenever a police officer decides they are now on-duty and can legally carry firearms.