The law was passed in the wake of a mass shooting in Newtown, Conn. in December that killed 20 schoolchildren and seven adults.
The law calls for a tough ban on assault weapons, provisions to keep guns out of mentally ill people who make threats, and restrictions on ammunition and gun sales.
The New York State Assembly passed the measure 104-43. The measure passed the Senate 43-18 on the strength of support from Democrats. Governor Andrew Cuomo signed the measure into law Tuesday afternoon. Cuomo had pushed hard for the bill.
"Common sense can win," Cuomo said. "You can overpower the extremists with intelligence and with reason and with common sense."
Owners of an estimated 1 million previously legal semiautomatic rifles, like the Bushmaster model used to kill 20 children and six adults in Newtown, Conn., a month ago, will be allowed to keep their weapons but will have a year to register them with police.
Private sales of assault weapons to someone other than an immediate family will be subject to a background check through a dealer. New Yorkers also would be barred from buying assault weapons over the Internet, and failing to safely store a weapon could lead to a misdemeanor charge.
Ammunition magazines will be restricted to seven bullets, from the current 10, and current owners of higher-capacity magazines will have a year to sell them out of state. An owner caught at home with eight or more bullets in a magazine will face a misdemeanor charge.
Under current state law, assault weapons are defined by having two "military rifle" features such as folding stock, muzzle flash suppressor or bayonet mount. The proposal reduces that to one feature and includes the popular pistol grip.
Another provision places requirements on therapists, psychologists, registered nurses and licensed social workers who believe a mental health patient made a credible threat to use a gun illegally. They would be required to report such a threat to a mental health director, who would have to notify the state. Any registered handguns - or registered assault weapons purchased before the ban - could be taken from the patient.
The legislation also increases sentences for gun crimes including the shooting of a first responder that Cuomo called the "Webster provision." Last month in the western New York town of Webster, two firefighters were killed after responding to a fire set by the shooter, who eventually killed himself.
The governor confirmed the proposal, previously worked out in closed session, also mandate a police registry of assault weapons, grandfathering in the estimated 1 million assault weapons already in private hands.
It was agreed upon exactly a month since the Sandy Hook Elementary School tragedy.
"This is not about taking anyone's rights away," said Sen. Jeffrey Klein, a Bronx Democrat, when the bill passed the Senate late Monday night. "It's about a safe society ... today we are setting the mark for the rest of the county to do what's right."
Assemblyman Steve Katz said legislators were being "bullied." He said the bill is "solely for the governor's egotistical, misguided notion."
Republicans argued the bill wouldn't stop mass shootings or other gun crimes but instead turns law-abiding into potential criminals.
The Associate Press contributed to this report.