The Supreme Court is seen under stormy skies in Washington, Thursday, June 20, 2019. (AP Photo/J. Scott Applewhite)

The Supreme Court is seen under stormy skies in Washington, Thursday, June 20, 2019. (AP Photo/J. Scott Applewhite)

WASHINGTON (AP) — The Supreme Court says prosecutors must prove that people charged with violating federal gun laws knew they were not allowed to have a weapon. The government says the decision could affect thousands of prosecutions of convicted criminals who are barred from having a firearm.

The court ruled 7-2 Friday in the case of a foreign student from the United Arab Emirates who took target practice at a Florida shooting range, even though he had been dismissed from the Florida Institute of Technology and was in the United States illegally. He was prosecuted under a law that bars people who are in the country illegally from having guns.

ADVERTISEMENT

Prosecutors never proved that the student, Hamid Rehaif, knew he couldn’t have a gun, and lower courts ruled they didn’t have to.

The same law is also an important tool to keep guns away from convicted criminals. There were more than 6,000 convictions under the law during the government’s 2017 fiscal year, according to the U.S. Sentencing Commission.

Justice Stephen Breyer wrote in his majority opinion that the law at issue requires prosecutors to show both that the person had a gun and knew he shouldn’t.

Otherwise, Breyer said, the law could ensnare someone “brought into the United States unlawfully as a small child and was therefore unaware of his unlawful status.”

Justice Samuel Alito wrote in a dissent that was joined by Justice Clarence Thomas that the decision “opens the gates to a flood of litigation that is sure to burden the lower courts.”

The gun violence prevention group Everytown for Gun Safety had joined the Trump administration in urging the court to reject Rehaif’s arguments.

“We are concerned today’s ruling will make it harder for law enforcement to impose accountability when people keep or acquire guns they’re legally barred from possessing, including due to felony and domestic violence convictions,” said Eric Tirschwell, Everytown’s litigation director.

Rehaif was sentenced to 18 months in prison.

Friday’s decision may not be the last word in his case. Lower courts will take a new look at its details, including the school’s telling him his student visa would no longer be valid unless he transferred to another school. Prosecutors say Rehaif ignored the warning and instead spent months at a hotel in Melbourne, Florida, never re-enrolling in school.