Donald Trump has roared into the lead in the upcoming California Republican primary, bolstering his hopes of winning the GOP nomination and avoiding a nasty convention fight, a new poll has found.

In the first independent survey since it became apparent that the Golden State will play a major role in deciding the Republican presidential nominee, the nonpartisan Public Policy Institute of California found that Trump has the support of 38 percent of likely voters, while Texas Sen. Ted Cruz is favored by 27 percent. Ohio Gov. John Kasich placed a distant third with 14 percent.

On the Democratic side, Hillary Clinton, who appears well on her way to getting her party’s nomination, led Bernie Sanders by 48 percent to 41 percent, according to the poll released Wednesday.

Trump continues to surpass expectations. He is the leading candidate across age, income, education and gender groupings, the poll found, despite being targeted by a multimillion-dollar negative ad campaign and being called “a phony” and “a fraud” by the GOP’s 2012 nominee, Mitt Romney. Trump’s poll numbers have soared since the last major survey of California voters — a January Field Poll — which showed Cruz with a narrow lead.

Some of the state’s veteran political analysts said they weren’t surprised.

“California Republicans are deeply concerned about immigration, which is Trump’s signature issue,” said Jack Pitney, a former GOP staffer who is now a professor of politics at Claremont McKenna College.

While Sanders may benefit from independent voters who can cast ballots in California’s Democratic presidential primary, the closely watched GOP race is open to only registered Republicans.

At this point, there appears to be two possible outcomes of the Republican contest: Either Trump wins the 1,237 delegates he needs to claim the nomination — or no one does, and the fractured party is left to choose its nominee at its national convention in Cleveland.

With California awarding most of its 172 delegates equally to the winners in each of the state’s 53 congressional districts, Republican leaders, fearful that Trump would get creamed in the general election, are counting on Cruz to limit his delegate haul by beating him in a variety of districts where he is perceived as vulnerable.

But that will be a hefty challenge if Trump truly leads among every segment of the Republican electorate, said Bruce Cain, director of Stanford University’s Bill Lane Center for the American West.

“Not only is Cruz behind, but there is no obvious strategy as to who he can target or where he can target,” Cain said.

Switching gears to attack Trump statewide would “take an enormous amount of money,” Cain added. “But that might be the only strategy left given what the data show.”

Still, the PPIC’s president and CEO, Mark Baldassare, stressed that the results revealed potential trouble for the brash New York businessman: Trump might have already maxed out his support.

When Florida Sen. Marco Rubio dropped out of the race last week, Trump’s poll numbers held steady, while Rubio’s backers flocked to Cruz and Kasich. And one in five Republican voters told the PPIC they wanted “someone else” or hadn’t made up their mind.

“That is a significant sign that many Republicans are looking elsewhere besides Donald Trump and still deciding what to do,” Baldassare said.

Indecision also marks the race for U.S. Senate, where the top-two finishers in the June primary will face off in November regardless of party.

The poll found state Attorney General Kamala Harris with support from 26 percent of likely voters, while fellow Democrat Loretta Sanchez, a congresswoman from Santa Ana, was supported by 17 percent.

Republican candidates are lagging behind as 31 percent of voters remain undecided. Former state GOP Chairman Tom Del Beccaro, of Lafayette, polled at 9 percent. Duf Sundheim, of Los Altos Hills, also a former chairman of the state party, came in at 6 percent. Ron Unz, a Republican businessman who ran for governor in 1994, entered the race after polling had been completed.

The poll queried 1,039 likely voters from March 6 to 15. Rubio dropped out of the race late on March 15, so the PPIC recalculated the poll to include Rubio supporters’ second choices.

The margin of error was plus or minus 7.3 percentage points for the Republican primary, 6.2 percentage points for the Democratic primary and 4.4 points for all likely voters. The poll did not include a large enough sample size to break down Trump’s support by congressional district, Baldassare said.

While nearly two-thirds of Democrats said they were happy with their choices for president, less than half of Republicans and about one-third of independents felt the same way.

Ngan Tran, a 37-year-old independent voter from Santa Cruz, said he plans to cast an unenthusiastic vote for Clinton in the Democratic primary, which is open to independents.

“I wish there was someone better, but the Republican candidates disgust me,” Tran said. “I wish they would nominate someone more sane.”

Phil McGinniss, a Republican and retired municipal worker from Morgan Hill, said he might not vote for the next president if the race comes down to Clinton vs. Trump.

“She has lied to so many people, but he says so many crazy things all the time,” he said. “I’m a little afraid of that guy having so much power.”

Clinton owes her lead over Sanders in part to a 23-point advantage among Latinos and a 19-point lead among women, the poll found.

The sharpest divide centers on age. Clinton is supported by 63 percent of voters 45 and older, and Sanders is supported by 63 percent of voters younger than 45.

On the Republican side, the poll finds Trump’s support extending well beyond his ballyhooed base of working-class men without a college degree. Trump led Cruz by 25 percentage points among women; 12 percentage points among college graduates; and 6 points among voters with a household income above $80,000.

But Pitney said there was still time for the anti-Trump forces to coalesce around Cruz and force a contested convention that could nominate someone who hasn’t even participated in the primaries.

“There’s a lot of uncertainty this year,” Pitney said. “But one certainty is that a lot of Republicans are going to be very ticked off at the outcome.”

Contact Matthew Artz at 510-208-6435. Follow him on Twitter at Matthew_Artz.