The Brooklyn district attorney said on Tuesday that a scheme in which guns, even an AK-47 rifle, were taken onto passenger jets for years in carry-on luggage presented a terrorism threat and should lead to the end of workers’ being able to enter airports without security screening.

“I hope this is a wake-up call for the nation,” the prosecutor, Kenneth P. Thompson, said at a news conference. “This was an egregious breach of our nation’s air traffic security.”

Mr. Thompson described a case brought against five people, including an airline baggage handler who was charged a day earlier by federal authorities in Atlanta.

He said that he was not trying to scare anyone, but that it was “truly frightening” what investigators learned after an inquiry that started as a way to reduce gun violence in Brooklyn.