The Supreme Court said Monday that it will not take up a challenge to a federal law that restricts the ownership of gun silencers, attachments that muffle the sound of gunfire.

The court rejected an appeal brought by two Kansas men — Shane Cox, the owner of a military surplus store who sold a silencer, and Jeremy Kettler, the man who bought it. Kettler said he purchased the silencer to protect his ears because his hearing was damaged during military service. He also said the store owner told him that a silencer made and sold in the same state was not subject to the federal law that requires the devices to be registered.

That turned out to be bad advice. Both men were convicted and they appealed, claiming the law violates their Second Amendment right to bear arms.

Gun rights advocates have repeatedly tried to get Congress to ease the restrictions on silencers, but each time those efforts stalled after mass shootings. The governor of Virginia asked his state to consider banning silencers after a man using a handgun equipped with one of the devices killed 12 people last month in Virginia Beach.

Under the National Firearms Act, a person wishing to obtain a silencer must submit detailed information and seek permission from the Bureau of Alcohol, Tobacco, Firearms and Explosives, a process that is much different from the instant check system used to buy a gun and can take months. Still, the popularity of silencers has soared in recent years, and the ATF says almost 1.5 million are now registered.

Gun control advocates say, however, that silencers make it harder for first responders to pinpoint the source of gunfire and lead victims to think that the sound is coming from farther away.