The Supreme Court on Monday invalidated a key part of a law designed to prevent gun violence, saying it left too much leeway for judges to decide what constituted a violent crime. In a 5-4 ruling the justices said Congress was too vague when it tried to slap extra penalties on people who used guns while committing a “crime of violence.” “In our constitutional order, a vague law is no law at all. Only the people’s elected representatives in Congress have the power to write new federal criminal laws,” Justice Neil M. Gorsuch wrote in the court’s opinion. The ruling could lead to thousands of new appeals from people convicted under the vague law, prosecutors warned. The case involved two men who were convicted of a string of robberies. They carried firearms during the crimes, which earned them heightened sentences under the Gun Control Act, which kicks in for cases of a “crime of violence or drug trafficking crime.” The statute said crimes of violence are those where physical force is used or threatened against a person or property. But the justices have long grappled with what, exactly, meets that definition. In a series of cases Justice Gorsuch, joined by the court’s four Democratic-appointed justices, has ruled it’s too tough to say what falls under the law. “Vague statutes threaten to hand responsibility for defining crimes to relatively unaccountable police, prosecutors, and judges, eroding the people’s ability to oversee the creation of the laws they are expected to abide,” Justice Gorsuch wrote. Justice Brett M. Kavanaugh, writing the dissent joined by Chief Justice John G. Roberts Jr. and Justices Clarence Thomas and Samuel Alito, said the law was successful, and should have remained in place. “Many factors have contributed to the decline of violent crime in America. But one cannot dismiss the effects of state and federal laws that impose steep punishments on those who commit violent crimes with firearms,” Justice Kavanaugh wrote. John Marti, a former federal prosecutor now practicing at the Dorsey & Whitney law firm, said the decision will lead to a “title wave” of appeals from defendants convicted under the statute now struck down. “Today the Supreme Court eliminated this powerful tool for federal prosecutors in combating violent crime, by finding that the statute is unconstitutionally vague by using the phrase ‘crime of violence,’” Mr. Marti said.