D.C. Mayor Muriel E. Bowser (D) on Wednesday signed emergency legislation banning kits used to make untraceable “ghost guns” after the number of home-built firearms seized by police in the city spiked last year.

The D.C. Council swiftly passed the bill in a unanimous vote last week. It came after authorities learned that ghost guns were used in four recent fatal shootings, and another was fired at two reserve officers in what the police chief called an assassination attempt.

Ghost guns are so named because they aren’t built by traditional manufacturers and lack serial numbers used to trace ownership. The number of such firearms found at crime scenes, at arrests and in homes in the District rose from three in 2017 to 116 in 2019. At least another 38 have been seized this year.

Citing urgency, the mayor sought emergency status to bypass the normal process for enacting legislation. The new law will be in place for 90 days, and officials said they hope to enact a permanent law during that period.

Bowser signed the bill in private, after canceling a public ceremony that had been scheduled at Garfield Elementary School in the Buena Vista Terrace neighborhood in Southeast Washington. Bowser had to deal with pressing matters regarding the coronavirus.

The mayor had planned to tour the community located in Ward 8, where more than a third of the District’s homicides have occurred since 2018. Last year, the District had the highest number of homicides in a decade, and this year it is on a similar pace.

In a joint statement, Bowser and Council Member Charles Allen (D-Ward 6), who chairs the committee on the judiciary and public safety, said the new law will help authorities “stop the proliferation of untraceable guns and guns that people buy online and build at home in an attempt to get around the District’s carefully crafted, common sense gun laws.”

While home-built guns vary in quality, they all resemble traditionally made semiautomatic handguns and rifles. The types of ghost guns being used in the District, and in other cities, are made with kits that supply 80 percent of the gun — called the frame for handguns or the receiver for long guns — already cut out of metal or polymer.

Some minor drilling and milling is needed to add the other 20 percent. Both the “80 percent lowers” and the 20 percent remainder — the trigger, barrel and firing pin — are easily purchased online.

The Bureau of Alcohol, Tobacco, Firearms and Explosives has ruled that the 80 percent lower is not a firearm because it is unfinished and cannot fire a projectile. For this reason, there is no requirement that people buying the receivers undergo a background check, making them readily available to individuals such as felons or domestic abusers, with instructions for finishing the guns easily available on the Internet.

Gun rights advocates object to new laws such as the one going into effect in the District. They say that builders of ghost guns should be treated no differently from more-traditional gun manufacturers and that authorities should focus on people illegally distributing firearms.

Police said 2,299 illegal firearms were seized in the District in 2019, a 19 percent increase over the previous year.

In his opening remarks at a recent D.C. Council hearing, Police Chief Peter Newsham called trafficking in firearms more serious than possessing illegal weapons. He said targeting traffickers can “deter people from selling guns in the District, which endanger our residents, visitors and neighborhoods.”

But because ghost guns are in effect untraceable, it makes it difficult for law enforcement to find their source. Newsham has said detectives and federal agencies in the District have at least two investigations open “where we have found some folks that are assembling these guns.” He has declined to comment further.

Assembling a gun out of parts obtained through a gun dealer or the Internet is largely legal in the United States. Four states have enacted laws regulating or prohibiting such guns. It is illegal to build a firearm in the District; the new law makes it illegal for residents to possess the kits.

Officials said the makers of the kits have stopped selling them in other states that enacted similar bans.