The National Rifle Association (NRA) has filed a lawsuit in the US to block legislation that places new restrictions on guns in Florida.
Weeks after their children were gunned down in the worst high school shooting since Columbine, parents of the victims of the Marjory Stoneman Douglas High School killings stood in the state Capitol and watched Governor Rick Scott sign the far-reaching bill.
Hours later, however, the NRA filed a federal lawsuit to block it.
The new law capped an extraordinary three weeks of lobbying after the shooting at the high school, with student survivors and grieving families working to persuade a Republican-run state government that had shunned gun control measures.
Surrounded by family members of the 17 people killed in the Valentine's Day shooting, the Republican governor said the bill balances "our individual rights with need for public safety".
"It's an example to the entire country that government can and has moved fast," said Mr Scott, whose state has been ruled for 20 years by gun-friendly Republican lawmakers.
Tony Montalto, whose daughter Gina was killed in the shooting, read a statement from victims' families: "When it comes to preventing future acts of horrific school violence, this is the beginning of the journey. We have paid a terrible price for this progress."
The bill fell short of achieving the ban on assault-style weapons sought by survivors.
The gunman who opened fire at the school used such a weapon, an AR-15 rifle.
Nevertheless, the bill raises the minimum age to buy rifles from 18 to 21, extends a three-day waiting period for handgun purchases to include long guns and bans bump stocks, which allow guns to mimic fully automatic fire.
It also creates a so-called guardian programme enabling some teachers and other school employees to carry guns.
The NRA insisted that the measure "punishes law-abiding gun owners for the criminal acts of a deranged individual".
The Parkland gunman "gave repeated warning signs that were ignored by federal and state officials. If we want to prevent future atrocities, we must look for solutions that keep guns out of the hands of those who are a danger to themselves or others, while protecting the rights of law-abiding Americans," Chris W Cox, executive director of the NRA's Institute for Legislative Action, said in a statement.
The signing marked a major victory for the teens who lived through the attack and swiftly became the public faces of a renewed gun-control movement.
Just days after the shooting, they began holding rallies, lobbying lawmakers and harnessing the power of social media in support of reform.
The governor told the students: "You helped change our state. You made a difference. You should be proud."
Mr Scott, who said he is an NRA member and will continue to be one, said he is still "not persuaded" about the guardian program that will let districts authorise staff members to carry handguns if they complete law enforcement training. It is not mandatory.
"If counties don't want to do this, they can simply say no," he said.
The governor singled out two fathers whose children were killed, saying that they walked the halls of the Legislature since the shooting seeking change.
"I know the debate on all these issues will continue. And that's healthy in our democracy," he said. "This is a time for all of us to come together, roll up our sleeves and get it done."
Student activists from the school called it "a baby step".
"Obviously, this is what we've been fighting for. It's nowhere near the long-term solution," said Chris Grady, a senior at Stoneman Douglas High.
"It's a baby step but a huge step at the same time. Florida hasn't passed any legislation like this in God knows how long."
Former Republican congressman David Jolly: "It is an optimistic moment to see a governor take on the NRA, ... but realistically this law does nothing to advance comprehensive or universal background checks. It does nothing to address assault weapons or magazine clips." pic.twitter.com/RylSCuNhNZ— CNN Tonight (@CNNTonight) March 10, 2018
In schools, the measure creates new mental health programs and establishes an anonymous tip line for reporting threats. It also seeks to improve communication between schools, law enforcement and state agencies.
The 19-year-old former student accused of assaulting the school went before a judge on Friday.
Nikolas Cruz faces 17 counts of murder and attempted murder. In a brief hearing, he stood with his head bowed as he appeared via video conference.
Cruz's public defender has said he will plead guilty if prosecutors take the death penalty off the table and sentence him to life in prison instead.
Prosecutors have not announced a decision.