A federal judge on Thursday upheld the District’s tough gun registration laws, finding that regulations crafted in response to a landmark Supreme Court decision “pass constitutional scrutiny.”

“The people of this city, acting through their elected representatives, have sought to combat gun violence and promote public safety. The court finds that they have done so in a constitutionally permissible manner,” U.S. District Judge James E. Boasberg wrote in an opinion likely to be appealed by gun-rights advocates.

In 2008, the Supreme Court used a D.C. case brought by the same plaintiff to declare that the Second Amendment guarantees a person’s right to own a firearm for self-defense.

The lawsuit, one of many throughout the country that have challenged gun restrictions, took on the District’s post-2008 regulations that banned large-capacity magazines and assault weapons. The city also imposed stringent registration requirements for handguns and long guns.

The ban on specific firearms was upheld on appeal, but District officials were ordered to justify their registration requirements.

The city’s gun registry, run by the D.C. police department, prohibits residents from registering more than one gun a month.

Owners must appear in person at police headquarters to be photographed and fingerprinted; complete firearms training; and pass a test.

The registration expires after three years.

Boasberg said Thursday that he was persuaded that the city’s system allows the District to “screen out dangerous or irresponsible people who try to obtain a firearm.”

“Asking gun owners to take a short class and pass a minor test — once — in order to wield deadly weapons fits the District’s interests in public safety and police protection,” he wrote in the 62-page opinion.

Stephen Halbrook, the lead attorney for security guard Dick Heller and the other plaintiffs, said that the city’s requirements are far more restrictive than those in other jurisdictions and seem designed to dissuade people from registering.

“The more you pile on these requirements, the more work and more trouble it is. Some people aren’t going to go through this,” said Halbrook, who expects to appeal.

Mayor Vincent C. Gray (D) called the decision an “important win for public safety.”

In a statement, Attorney General Irvin B. Nathan said that although Boasberg “correctly noted that safety here ‘has improved markedly in this millennium,’ we still are beset with too many lives needlessly lost through the use of firearms. I hope that these regulations and our enforcement efforts will help stem the tide.”

D.C. Council Chairman Phil Mendelson (D), who played a leading role in rewriting the laws after the Supreme Court’s Heller decision, said the council tried to balance the government’s interest in public safety with individual rights by “minimizing the burden on legitimate firearms’ owners.”

“I don’t think the nation’s capital would be safer if anybody were allowed to carry a firearm anywhere,” Mendelson said Thursday.

In a series of other cases, including in the District, federal judges have also been wrestling with the question of whether the individual right to keep a firearm in one’s home for self-defense extends beyond the home.

Attorney Alan Gura, who represents the pro-gun Second Amendment Foundation, recently renewed his request to the U.S. Court of Appeals for the D.C. Circuit to compel a lower-court judge to rule in a D.C. case that was first filed in 2011 and has been pending since the last hearing in October 2012.

Get updates on your area delivered via e-mail