SACRAMENTO, Calif. — Gov. Gavin Newsom has signed bills to crack down on doctors who write fraudulent medical exemptions for children's vaccinations.

Newsom acted less than an hour after lawmakers on Monday sent him changes he demanded as a condition of signing an earlier vaccine bill.

Lawmakers passed the companion bill Monday despite protesters' efforts to disrupt the proceedings. Newsom last week called for more changes to legislation aimed at doctors who sell fraudulent medical exemptions.

Lawmakers sent Newsom that bill last week. But Sen. Richard Pan agreed to carry follow-up legislation giving school children grace periods that could last several years on existing medical exemptions.

The companion bill also makes it clear that enforcement will start next year and removes a requirement that doctors swear under penalty of perjury that they're not charging fees to fill out medical exemption forms.

Opponents continued their protests, with several detained as they blocked Capitol entrances.

The Senate was expected to take up the bill later Monday, but action was delayed as protesters unfurled an upside-down American flag from the Senate's public gallery in a traditional signal of distress while opponents chanted "My kids, my choice" and "We will not comply."

An apparent counter-protester unfurled a black banner reading: "We the People v. the Vaccine Extremists."

RELATED: California lawmaker, governor reach deal on vaccine bill

The two bills are needed "so we can keep children safe from preventable diseases," Democratic Assemblyman Jim Wood of Santa Rosa said before the Assembly approved the measure with a 43-14 vote.

Republican Assemblyman Devon Mathis of Visalia objected that there were no committee hearings on the last-minute bill.

"This goes past vaccines and is again a major government overreach," Mathis said, adding that, "Our medically fragile children are what are at stake."

Newsom demanded a phase-out period for medical exemptions similar to one allowed when California eliminated personal belief vaccine exemptions in 2015. A kindergartener with an exemption could retain it through 6th grade, for instance, while a 7th grader could be exempted through high school.

RELATED: California lawmakers OK vaccine limits; Newsom seeks changes

Several opponents of the bill were detained before the legislative session as they blocked entrances to the Capitol, including two women who briefly chained themselves to an outside doorway. About 200 others filled the hallway in front of the governor's office, asking Newsom to veto both vaccine bills.

The companion bill also would allow officials to revoke any medical exemptions written by a doctor who has faced disciplinary action.

The bill would make it clear that enforcement will start next year, meaning doctors who previously granted a high number of medical exemptions won't face scrutiny.

RELATED: Measles cases in Europe double in 'dramatic resurgence'

WATCH MORE: Hundreds of parents protest California vaccine exemptions bill SB276 | RAW