SACRAMENTO — Neel Kashkari, the underdog in California’s race for governor, launched a fusillade of attacks on Gov. Jerry Brown on Thursday night in their first and probably only debate.

The two candidates, who had never met before the event at Sacramento’s Senator Hotel, sparred over a wide range of issues, including high-speed rail, the economy, immigration and California’s public schools.

At times, they shouted over one another to get the last word.

Brown, 76, portrayed himself as an experienced veteran who came to the Capitol four years ago ready to roll up his sleeves to reduce the state’s $27 billion deficit — which he noted is now a surplus.

But Kashkari, a 41-year-old asset manager from Laguna Beach and former U.S. Treasury Department official, painted the Democratic governor as an out-of-touch career politician, while describing himself as a “middle-class kid” who is seeking the state’s highest office to help restore California’s middle class.

The part of the debate that centered on the state of California’s public schools was the most contentious.

When asked why he’s appealing the recent Vergara v. California court ruling that found the quality of California’s public schools so poor that it violates some students’ constitutional rights, Brown blamed the schools’ woes on insufficient funding and problems communicating with students just learning to speak English.

Kashkari, however, accused Brown of putting the interests of the California Teachers Association ahead of struggling students.

“You had a choice between fighting for the civil rights of poor kids and fighting for the union bosses who funded your campaigns,” Kashkari said. “You sided with the union bosses. You should be ashamed of yourself, governor.”

Brown and his supporters point out that during his first term he led efforts to overhaul California’s school funding formula, eliminating many restrictions on the way districts use their state aid and promising greater spending on poorer students.

Midway through the debate, Brown zeroed in on a criticism of Kashkari that he repeated several times — Kashkari’s experience working for Goldman Sachs and as a government official who helped run the unpopular Troubled Asset Relief Program, known as TARP.

Kashkari defended TARP’s work, saying the program had made money for the government. But Brown railed against him for the generous bonuses given to the CEOs of bailed-out banks.

During the debate, Brown revealed his plans to sign a contentious bill that will make California the first state to ban single-use plastic grocery bags.

That led Kashkari to accuse Brown and Democrats in the Legislature of focusing too narrowly on minor issues like the bag ban, instead of finding ways to put people back to work.

“The time for incrementalism has long since passed, governor,” Kashkari said. “We actually need bold reforms to rebuild the middle class. Plastic bags isn’t going to do it.”

But Brown pointed out that more than 1 million new jobs were created during the first three years of his third term.

Water issues and California’s bullet train also took center stage.

Brown is the train’s main champion, but Kashkari pledged: “I’m going to cancel the high-speed rail train and invest in water in a big way.”

He added that Gov. Pat Brown, the governor’s father, “understood how important water is. Water and schools must come first.”

Kashkari, who was 16 points behind Brown in a Field Poll released Thursday, is running his campaign on a shoestring budget. He had proposed 10 head-to-head events. But Brown, who had $22 million in the bank for the campaign at the end of June, said at the end of the debate that he thought one was enough.

“I think we’ve exposed the differences,” Brown said. “This is a format they’ll play over and over again.”

Two veteran political analysts said they thought Kashkari won the debate.

“His answers were crisper and more direct,” said Jack Pitney, a political science and government professor at Claremont Mc-Kenna College. “And he stayed on focus. He kept bringing the debate around to the topics he wanted to talk about, which were jobs and education.”

Bill Whalen, a research fellow at Stanford’s Hoover Institution, said “the governor was not knocked down,” but agreed that Kashkari did better in terms of style and points.

“He was more coherent than the governor,” Whalen said. “More times than not, the governor went off into Jerry Brown mode where he was not answering the questions.”

But Martinez resident Kamla Fitzell, 76, a registered Democat, said she thought Brown won because he was able to defend his record.

She said she was surprised that Kashkari was so aggressive: “He was attacking Jerry Brown personally, making sure we know Jerry Brown comes from a rich background — which is true. But he did that so many times that it kind of made me think, ‘Don’t be so petty.'”

But Gary Stewart, 51, a registered Republican from Livermore, said he thought Kashkari’s debate strategy was effective.

“Gov. Brown has always been a rich liberal,” Stewart said. “He grew up in a family and always had things handed to him — whereas Kashkari is a middle-class kid who grew up understanding how the world works.”

Contact Jessica Calefati at 916-441-2101.