The D.C. attorney general on Friday declined to charge the host of NBC’s “Meet the Press” for displaying an empty ammunition magazine on national television, saying that doing so would not make the District safer.

The decision, coming amid a charged debate over gun laws, spares journalist David Gregory the possibility of jail time. But the attorney general warned the network “of the gravity of the illegal conduct . . . in a city and a nation that have been plagued by carnage from gun violence.”

In a letter to NBC, Attorney General Irvin B. Nathan admonished Gregory for knowingly flouting the law, but Nathan said he decided to exercise “prosecutorial discretion” and not pursue a criminal case. “Prosecution would not promote public safety in the District of Columbia, nor serve the best interests of the people,” Nathan wrote.

The letter ends a nearly three-week-long investigation by D.C. police, prompted by viewers who e-mailed the department after watching Gregory display a 30-round ammunition magazine during a Dec. 23 interview with the National Rifle Association’s executive vice president, Wayne LaPierre. The two were talking about the school shootings in Newtown, Conn.

Those viewers demanded that Gregory be arrested, citing a law that makes it illegal in the District to possess a magazine, even an empty one, capable of holding more than 10 rounds of ammunition. It’s a misdemeanor punishable by up to a year in jail and a $1,000 fine.

The “Meet the Press” host is under investigation by D.C. police for displaying what appeared to be an illegal high-capacity ammunition clip in an interview with the NRA’s Wayne LaPierre Sunday. (The Fold/The Washington Post)

Police investigated and sent Nathan the case Tuesday. After Friday’s decision, authorities would not say whether detectives had recommended prosecution. D.C. Police Chief Cathy L. Lanier declined to comment, as did the department’s chief spokeswoman.

Authorities would not say whether detectives interviewed Gregory. The attorney general said his office received a letter Jan. 9 explaining NBC’s position. Nathan said that NBC returned the clip to its owner, who lives outside the District, and the owner surrendered it to D.C. police.

Gregory has not commented on the incident either in interviews or in television and radio appearances. He has continued hosting “Meet the Press” and has spoken about the gun debate that has followed the school shootings. He interviewed President Obama at the White House while he was under investigation.

The director of communications for NBC News, Erika Masonhall, issued a statement saying that NBC “displayed the empty magazine solely for journalistic purposes to help illustrate an important issue for our viewers. We accept the District of Columbia Attorney General’s admonishment, respect his decision and will have no further comment on this matter.”

Many gun advocates say that not charging Gregory demonstrates the hypocrisy of selectively enforcing some of the nation’s strictest gun laws. Those on the other side of the issue maintain that charging Gregory would be a waste of time and resources better spent on curtailing violence.

Ilya Shapiro, an attorney and senior fellow for constitutional studies at the Cato Institute, praised Nathan for what he called “a wise use of prosecutorial discretion.” He said that police had to investigate but that “this illustrates the absurdity of some of these gun laws.” Shapiro, along with Cato’s chairman, led the effort in 2008 to strike down the District’s gun laws and allow possession of firearms in city homes.

Both Shapiro and the president of the NRA — the latter speaking to CNN last month — agreed that Gregory should not be prosecuted.

But their position runs counter to that of thousands of gun advocates who insist that Gregory should be held as accountable as anyone else and who signed a White House petition urging his arrest. They point out that NBC had asked D.C. police about the legality of displaying a gun magazine and that police warned the network such a presentation would be illegal.

Nathan, in his letter, addressed that issue. He called the network’s efforts to learn the law “feeble and unsatisfactory” and said there were other legal ways for Gregory to make his point.

But Nathan noted that Gregory’s “intent of the temporary possession and short display of the magazine was to promote the First Amendment purpose of informing an ongoing public debate about firearms policy in the United States.”