Gov. Ron DeSantis on Friday vetoed a sweeping social media bill that would have effectively barred Florida residents under the age of 16 from opening accounts on services like TikTok and Instagram, even if their parents permitted them to do so.

In a post on X, Mr. DeSantis said he had vetoed the teen social media ban bill because the state’s Legislature was “about to produce a different, superior bill” that recognized parents’ rights. Last week, the governor had suggested the measure went too far by superseding the authority of parents.

Soon after the news of the veto, Paul Renner, a Republican who is the speaker of the Florida House of Representatives, said in a post on X that the new bill would be “an even stronger product to protect our children against online harms.”

While several states have recently passed laws requiring parental consent for children’s social media accounts, the Florida measure that Mr. DeSantis vetoed was designed as a more blanket ban. It would have required certain social networks to verify users’ ages, prevent people under 16 from signing up for accounts and terminate accounts that a platform knew or believed belonged to underage users.

Parents’ groups including the Florida Parent-Teacher Association had urged Mr. DeSantis to veto the bill after the state’s Legislature passed it last week.

The bill would almost certainly have faced constitutional challenges over young people’s rights to freely seek information. It also would have likely ignited online protests from teenagers who rely on social apps to communicate with friends and family, express themselves creatively, keep up with news and follow political, sports, food and fashion trends.

NetChoice, a trade group representing Meta, Snap, TikTok and other tech companies, said it welcomed Mr. DeSantis’s veto. In an email, Carl Szabo, NetChoice’s vice president and general counsel, said the measure, if signed, would have “replaced parents with government and Silicon Valley.” He added that the bill’s provision requiring social media sites to verify users’ ages would have led to “data collection on a scale never before seen in the state.”

Now Florida lawmakers are planning to amend a different bill that would regulate sexually explicit online material “harmful to minors,” adding provisions to restrict certain social networks that have “addictive features,” like endless content scrolls.

That bill would require pornography websites to verify users’ ages and keep out those under 18. Over the last two years, Louisiana, Utah, Mississippi and other states have enacted similar laws.

In his post on X, Mr. Renner said the amended bill would “empower parents to control what their children can access online while also protecting minors from the harm caused by addictive social media platforms.”

The Supreme Court is weighing free speech challenges to other social media laws, in cases that could reshape the internet. One of those cases involves a 2021 Florida statute, currently on hold, that would prohibit platforms like Facebook and X from permanently barring political candidates. (NetChoice is one of two tech trade groups challenging the state laws in the Supreme Court cases.)

But the Florida teen social media ban bill that Mr. DeSantis vetoed on Friday went further, representing one of the most restrictive measures that a state legislature has passed so far amid an escalating national effort to crack down on services like TikTok and Instagram in the name of child safety.

Over the last 18 months, other states have passed new online safety rules that would still allow younger teens to use social media.

Utah, Arkansas, Texas and Ohio last year passed laws that would compel social networks to verify users’ ages and obtain a parent’s permission before giving accounts to children under 16 or 18. In 2022, California passed a law that would require social networks and video game apps used by minors to turn on the highest privacy settings — and turn off certain features like auto-playing videos — by default for those young people.

The crackdown on social media stands out for being unusually bipartisan. California, a Democratic-led state, and Utah, a Republican-led state, each recently enacted landmark laws that take different approaches to protecting young people online. Separately, Florida last year became the first state to require public schools to ban student cellphone use during class time.

Balancing new social media restrictions with free speech rights can be tricky. NetChoice has successfully sued to halt the new laws in Arkansas, California and Ohio. Judges in those cases said the children’s online safety statutes most likely impinged on NetChoice members’ free speech rights to distribute information as well as young people’s rights to have access to it.

Mr. DeSantis said last week that he was “wrestling” with the Florida bill and weighing it against parents’ rights to make decisions about their children’s online activities.

“You’ve got to strike that proper balance when you are looking at these things between policy that is helping parents get to where they want to go versus policy that may be outright overruling parents,” he said.