A federal judge in Buffalo today has upheld the SAFE Act except for the magazine restriction.

That means New York’s tougher gun control laws are constitutional, excluding the limit of magazines to seven rounds.

U.S. District Judge William Skretny ruled that the SAFE Act does not infringe the Second Amendment. He said in the ruling that the SAFE Act, quote, “furthers the state’s important interest in public safety.”

He added that the “seven-round limit fails the relevant test because the purported link between the ban and the state’s interest is tenuous, strained and unsupported in the record.”

The State Rifle and Pistol Association and other gun-rights groups filed papers in March to challenge the law.

The SAFE Act was passed about a year ago in response to the Sandy Hook elementary school massacre. New York was the first state to pass such laws after the tragedy.