An armed off-duty law enforcement officer carrying a gun is called a "LEO"...
Most of them are off-duty FBI, ATF and local police officers who have had threats upon their lives and they carry the gun for personal protection reasons.
It has been happening for years. They always preboard and have to chat with the Captain.
They have to have an official letter for EACH flight they take from their superior as well as airline and TSA paperwork. They cannot just show a badge and board a plane with a gun.