ALBANY, N.Y. (AP) A federal judge has upheld most of New York's new gun control law, rejecting arguments that its bans on large-capacity magazines and the sale of some semi-automatic rifles violate Second Amendment rights.

Judge William Skretny in Buffalo says those provisions are constitutional because they're related to achieving an ``important governmental interest'' in public safety. He says those two features make guns more lethal.

Skretny struck down the restriction on gun owners loading more than seven bullets in a legal 10-round magazine, saying that appears to be ``an arbitrary number.''

The law was adopted last January following the mass shooting at Sandy Hook Elementary School in Newtown, Conn.

The New York affiliate of the National Rifle Association, sportsmen's groups, firearms businesses and gun owners filed the suit.