The Transportation Security Administration, the federal agency that oversees security at American airports, confiscated 3,957 firearms from travelers’ carry-on bags in 2017, a record high, the agency reported this week.

The figure represents a 17 percent increase from 2016, when TSA discovered 3,391 guns at security checkpoints, and a 500 percent increase from 2005, the first year the agency released gun seizure statistics. That year, 660 guns were found.

A full 84 percent of guns seized from carry-ons in 2017 were loaded, and 35 percent had a round chambered.

The TSA said Hartsfield-Jackson airport in Atlanta led the nation in firearm discoveries, with 245 guns, 90 percent of which were loaded. Coming in second was Dallas/Fort Worth International, with 211 guns, 78 percent of which were loaded.

While it’s illegal to carry a gun on an airplane, it’s legal to pack firearms in checked baggage, as long as they’re unloaded and stored in a hard-sided container. Ammunition is also permitted in checked baggage and must be stored in the same hard-sided case. Passengers are required to declare firearms in checked luggage at airline ticket counters. Travelers whose weapons are seized at security checkpoints risk arrest and could incur fines ranging from $3,000 to $7,500.

“As far as what happens to confiscated firearms, that’s up to each local police department,” the agency said in a recent Instagram post.

The TSA cautions airline passengers to consult the gun possession and carry laws of the states they’re traveling to, because what is permitted in one state might be prohibited in another. Last weekend, a South Carolina man was arrested when he tried to check a .40-caliber handgun at a ticket counter in Albany, New York. His crime: He didn’t have a New York State pistol permit. At the same airport two weeks earlier, a Colorado woman was arrested upon declaring a handgun in her checked baggage.

A piece of legislation that passed the House of Representatives late last year would immunize gun owners with concealed carry permits from such arrests. The Concealed Carry Reciprocity Act, a chief legislative priority for the National Rifle Association, would force states to recognize each other’s gun permits. The bill has been sitting in a Senate committee since December.

Dennis B. Coppin, a New York defense attorney who has represented gun-toting passengers who run afoul of local laws, told The New York Times in 2013 that the presence of a gun in a carry-on bag fails to raise alarms with some travelers because “they’re so used to carrying it.”

In the first annual gun seizure roundup that the TSA published on its popular blog in 2011, the agency said that most passengers caught with firearms “simply state they forgot they had a gun in their bag.” That included a 76-year-old passenger in Detroit, who walked through a body scanner that December with a loaded .380 pistol strapped to his ankle.

“You guessed it, he forgot it was there,” Bob Burns, the TSA blog’s author, wrote.

Someone who also “forgot it was there”: Haley Barbour, the former governor of Mississippi, who was arrested earlier this month at the Jackson, Mississippi, airport with a .38-caliber revolver in his briefcase.

“This was absent mindedness and nobody’s fault but mine,” Barbour said when news of his detention was made public on Tuesday.