Ted Cruz trounced Donald Trump in Wisconsin’s presidential primary on Tuesday, a victory that could change the dynamics of the Republican race. It also raises doubts about Trump’s ability to lock up a majority of delegates by the time of the GOP convention in July.

Meanwhile, Bernie Sanders defeated Hillary Clinton in the state, as the Vermont senator added to a string of victories and hoped to gain momentum as the race turns to New York on April 19.

Speaking to supporters in Milwaukee, Cruz predicted that he would have a majority of delegate before the Republican convention or after it starts in July. He noted that “three weeks ago the media said that Wisconsin was a perfect state for Donald Trump.”

“Hillary, get ready, here we come,” Cruz said, assuming that Clinton will ultimately be the Democratic nominee.

Trump’s loss comes after a series of campaign controversies, including comments he made to MSNBC’s Chris Matthews last week suggesting that women who had abortions should be subject to punishment. His campaign later issued a statement reversing that position.

Just as damaging to Trump have been polls showing Trump trailing Clinton and Sanders in a general election match up, with the real estate mogul drawing high negatives among women voters. That has given fuel to Trump’s GOP critics that he is not electable, and his loss will boost hopes among backers of anti-Trump efforts that he can be stopped. Trump leads in polls in upcoming primary states, including his home state of New York, but he already is facing a wave of media coverage on whether his campaign squandered momentum coming out of his wins in Super Tuesday contests last month.

In a statement, Trump’s campaign said that he “withstood the onslaught of the establishment yet again,” noting a flood of spending from anti-Trump SuperPAC spending. His campaign accused Cruz of coordinating with his SuperPAC, which is prohibited, and added, “Ted Cruz is worse than a puppet — he is a Trojan horse, being used by party bosses attempting to steal the nomination from Mr. Trump.”

Trump is still the front runner, but his Wisconsin loss raises the chances that there will be a contested convention, with no candidate arriving in Cleveland for the convention with a majority of committed delegates. It also means that California is likely to be a critical state for the candidates, with June 7 the final big delegate prize. The onus will be on Trump, Cruz and John Kasich to campaign in the Golden State, but also spend heavily in its expensive media markets.

While Sanders has been on a winning streak, he trails Clinton in the delegate race. He also had a rough interview earlier this month with the editorial board of the New York Daily News, which released the transcript on Monday. But he continues to draw large crowds to his rallies, and outpaced Clinton in fundraising in March, drawing $44 million to her $29.5 million.

Speaking to supporters in Laramie, Wyo., Sanders noted that his campaign had won seven out of the last eight contests, and that he was leading Trump in general election polling by a wider margin than Clinton.

“I believe we have got an excellent chance to win New York and a lot of delegates in that state,” Sanders said, adding that the campaign also has an “excellent chance” to win in California and Oregon. He said that would help convince super delegates, who have so far been flocking to Clinton, to back him.

“We have a path toward victory, a path toward the White House,” he said.