“I’d rather they just don’t teach anything if they can’t be honest,” said Susan Lontine, a Colorado state representative who introduced the bill. Ms. Lontine, who filed a sexual harassment complaint against a fellow lawmaker last year, connected the bill to the #MeToo movement. Allegations of sexual harassment rocked Colorado’s legislature in 2018, resulting in the expulsion of a Democratic lawmaker accused of harassing several women in government.

“The sooner we talk to kids about what consent looks like,” Ms. Lontine said, “the sooner I hope a tide will turn so we’re no longer hearing stories of people being harmed.”

During a 10-hour debate on the bill last month, which was attended by hundreds of people, opponents condemned homosexuality, accused a Democratic lawmaker of being a pedophile and falsely claimed it would allow schools to teach explicit sex acts to 9-year-olds. Much of the outrage was spurred by social conservative groups, which sent emails to their followers that contained incorrect information about the legislation.

Lawmakers opposed to the bill objected to lessons about lesbian, gay, bisexual and transgender people, argued that sex education should be taught at home, and claimed that children removed from the lessons would be bullied. The legislation allows parents to withdraw their children from the curriculum.

The backlash follows similar protests nationwide by conservative organizations against comprehensive sex education. After California passed the Healthy Youth Act of 2016, which required school districts to provide comprehensive sex and H.I.V. education, along with lessons on sexual orientations and healthy relationships, parents flooded school boards with accusations that the curriculum was “pornographic.” Last year, parents opposed to comprehensive sex education staged “Sex Ed Sit Out” protests in cities around the country, a campaign organized by national conservative groups.

Debra Hauser, president of Advocates for Youth, a nonprofit sexual health organization in Washington, D.C., whose comprehensive sex education curriculum is used widely in California, said the backlash in Colorado fits a pattern of coordinated misinformation campaigns that are used to stoke fear and are promoted on social media.

Ms. Hauser said she has been pleased to see teenagers and young adults mobilizing their communities on behalf of comprehensive sex education. “They want to take it into their own hands,” she said.