Capping years of efforts to stop California’s foster care system from overmedicating the state’s most vulnerable children, Gov. Jerry Brown on Thursday signed a controversial bill that for the first time puts doctors who recklessly prescribe psychiatric drugs at risk of losing their medical license.

The measure is part of a series of sweeping legislative reforms inspired by this news organization’s series “Drugging Our Kids” that disclosed the state’s dependence on psychotropic medications to control troubled children in the country’s largest child welfare system.

Senate Bill 1174, by Sen. Mike McGuire, will require annual monitoring of high-prescribing doctors and allow the California Medical Board to crack down on violators — a major victory for foster youth advocates who for years had no voice to speak out against their doctors’ orders.

“This bill ensures the state takes a no-tolerance approach to over-prescribing and that the Medical Board and attorney general get the data they need to protect California’s 66,000 foster youth,” said McGuire. The Healdsburg Democrat held a series of oversight hearings to champion the rights of foster youth who said they were being overmedicated.

McGuire’s bill was the focus of a tense legislative battle in Sacramento with one of the state’s most powerful interests — psychiatrists who argued the bill would unfairly single out doctors who treat children with severe mental health needs.

A Bay Area News Group analysis of five years of prescribing data revealed a fraction of the doctors may be fueling the medication use. A mere 10 percent of the state’s highest prescribers were responsible about 50 percent of the time when a foster child received an antipsychotic, the riskiest class of the drugs with some of the most harmful side effects.

Veteran child psychiatrist Michael Barnett, whom the news organization’s analysis identified among the higher prescribers of antipsychotics, said he supports the new oversight but will continue to prescribe the drugs — even two at once — when he believes it will help his young patients.

“There are definitely times where you could easily rationalize prescribing two antipsychotics to an individual,’’ he said. “I will still do that. And if they want to give me a speeding ticket (under the new law SB 1174) or ask me about it, I will tell them about it.’’

McGuire’s bill was one of three sent to Brown’s desk this year, after the governor signed three separate bills last year in the first wave of legislation spurred by this news organization’s series. On Thursday, Brown also gave his blessing to Senate Bill 1291, by Sen. Jim Beall, D-San Jose. It will require more transparency and tracking of mental health services for foster kids in every California county.

“We cannot allow our foster care system to strictly rely on dosing foster children with mind-altering medications to manage their behavior,’’ Beall said in a statement Thursday.

“We must ensure that less invasive and safer available treatments are the first options for our children rather than a pill. The system must provide foster youth with the services that address their trauma instead of depending on drugs to mask their trauma.’’

Beall’s legislation responds to recent state audit findings that revealed the foster care system has failed to adequately oversee the use of psychotropic drugs on foster children.

Advocates for foster youth, including the National Center for Youth Law, which sponsored the bills, celebrated the signings after years of pushing policy makers and state officials for reforms.

Policy director Anna Johnson said the nonprofit group is “grateful to our legislative champions for holding accountable the doctors who are overmedicating foster youth” and counties that she said “failed to provide services that will help foster youth deal with trauma, abuse and neglect.”

But the governor also vetoed one of the group’s measures, saying it was too similar to legislation he signed last year. Senate Bill 253 by Sen. Bill Monning, D-Carmel, sought to create more rigorous court oversight before doctors can prescribe potentially harmful psychotropic drugs to foster children.

The governor’s veto was a blow to National Center for Youth Law attorney Bill Grimm, who has always considered SB 253 the linchpin of legislative reforms to curtail the inappropriate, harmful impact of psychotropic drugs — before they can be prescribed.

Still, the new laws are especially meaningful to current and former foster youth, such as Sarah Pauter, of San Diego. Growing up in foster care, she was so over-medicated with antidepressants, anticonvulsants and mood stabilizers that she went from being a straight-A high school student to attending a center for the learning-deficient.

She is particularly pleased that Beall’s bill will force counties to provide better mental health alternatives to medications, and she is thrilled that McGuire’s bill will finally “hold psychiatrists accountable’’ for dangerous prescribing.

“Finally,” she said, “we have a law that says, ‘If you don’t do right by these foster kids, there will be consequences.’’’