Both parties' presidential front-runners lost the Wisconsin primary Tuesday as GOP Sen. Ted Cruz beat Donald Trump and Democratic Sen. Bernie Sanders bested Hillary Clinton, virtually assuring heated battles all the way to the final primaries in June, including California.
The results increase the odds that Republicans will have a contested party convention in July and force Mrs. Clinton to fight longer than anyone expected to clinch her party's nomination.
"Tonight is a turning point. It is a rallying cry," Mr. Cruz told supporters in Milwaukee after he finished ahead of Mr. Trump and Ohio Gov. John Kasich. "We have a choice, a real choice."
The GOP result was a hard-won victory for anti-Trump forces who had seen the Wisconsin primary as their last, best hope to slow the front-runner's momentum toward the Republican nomination.
Mr. Trump's campaign issued a defiant statement in response to the outcome, saying Mr. Cruz was a tool of an establishment dead set against him.
"Ted Cruz is worse than a puppet," the statement said. "He is a Trojan horse, being used by the party bosses attempting to steal the nomination from Mr. Trump."
The Texas senator's victory followed one of the rockiest weeks of Mr. Trump's campaign. Trailing in the polls and under concerted attack from Republican leaders in the state, Mr. Trump also weathered a series of controversies over abortion and other issues that threatened to undercut his standing with women voters.
Wisconsin will award its 18 at-large delegates to Mr. Cruz as the statewide winner. He's likely to also win a vast majority of the 24 delegates divided among the state's eight congressional districts, though district-by-district results weren't yet available.
Mr. Cruz's strong showing will make it more difficult for Mr. Trump to wrap up the 1,237 delegates needed for the GOP nomination before the primary season ends on June 7, when California allocates the largest number of delegates.
Next up on the GOP calendar is the April 19 primary in New York, Mr. Trump's home state, where polls show him with a commanding lead of more than 30 percentage points over Mr. Cruz, who in some surveys runs behind Ohio Gov. John Kasich.
New York awards 95 delegates, most of which are allotted proportionately by congressional district. Mr. Trump plans to campaign on Long Island on Wednesday.
"Trump has more support than anyone else in New York and always had," said state assemblyman Bill Nojay of Pittsford, in north-central New York. "If the vote was held today, we expect he would win every single congressional district."
A week later, a swath of other East Coast states vote -- Connecticut, Delaware, Maryland, Pennsylvania and Rhode Island. Mr. Cruz's best hope is in states further ahead in the calendar -- Indiana on May 3 and Nebraska on May 10.
Wisconsin -- with its GOP electorate dominated by the kind of working-class, white voters who have been drawn to Mr. Trump elsewhere -- was long seen as fertile ground for the New York businessman. But it turned into a hotbed of anti-Trump sentiment.
"We have to stop Trump," said Mary Czarra, 65 years old, of Menomonee Falls, who voted for Mr. Cruz even though she preferred Mr. Kasich. "He insulted our governor, for crying out loud. You can't do that if you're a Republican here."
Mr. Cruz was endorsed by Wisconsin Gov. Scott Walker, still a hero to the state's conservatives even though his 2016 presidential campaign fizzled.
Mr. Trump lambasted Mr. Walker and others in the state party establishment who opposed him, and their assault on the front-runner backfired among voters like Jim White, 62, of Milwaukee.
"I see the GOP fighting this guy all the way, and I don't like it," Mr. White said. "My feeling is this is about to destroy a lot of people; they won't vote ever again if Trump loses."
Holding out hope for a come-from-behind victory, Mr. Trump spent the past week stumping across the state, even skipping his grandson's bris Sunday to greet voters at a Milwaukee diner.
"He cannot downplay the significance of Wisconsin, because he moved here for the final week," said Brian Fraley, a Republican operative based in the Milwaukee suburb of Brookfield. "He went to every corner of the state. He was everywhere and he worked it hard, so he can't say that little Wisconsin didn't mean much. If it didn't mean much, he wouldn't be investing time and energy here."
Wisconsin's primary had been seen as a tough test for Mr. Cruz because he has struggled in other Midwestern industrial states including Michigan and Illinois. Most of his victories over Mr. Trump have come in states that hold caucuses -- time-consuming events that play to his grass-roots organizational strength. Wisconsin's primary also is open to Democrats and independents, not just registered Republicans.
Mr. Trump has done better in open primaries, while Mr. Cruz improves where balloting is limited to the party faithful. But with an equally competitive Democratic race between Mrs. Clinton and Mr. Sanders for their party's nomination, it was unclear if Mr. Trump could pull away cross-party voters.
Before Tuesday, Mr. Trump had 737 delegates, Mr. Cruz had 475. Even if Mr. Cruz ended up winning all 42 delegates from Wisconsin, it was unlikely there are enough bound delegates left for him to reach 1,237 before the convention.
For Mr. Trump, locking up the nomination during the primary season is possible but increasingly difficult, raising the chances that Republicans will choose their nominee in Cleveland, in a contested convention.
Messrs Cruz and Trump have played down suggestions that another candidate would be nominated if the convention deadlocked, and warned that grass-roots Republicans would rebel if that happened.
Mark Meckler, a tea-party activist who hasn't endorsed any candidate, agreed. "As for the chatter about a contested convention, if neither Cruz nor Trump are the nominee, the Republican Party will end in a fiery crash and Hillary Clinton will be our next president," he said. "Many in the grass-roots movement say they will simply not vote."
The next several primaries are in East Coast states where Republicans are likely to be less receptive to Mr. Cruz's religious, antiestablishment brand of conservatism than they are in Wisconsin.
"This is the last state in which Ted Cruz has any ability to win a state through the rest of April, and in some of them, he's going to be fighting for second place," said Sarah Huckabee Sanders, a Trump adviser and daughter of former presidential rival Mike Huckabee. "Moving forward, the momentum will all be on Trump's side."
In the run-up to Wisconsin, a series of controversies damaged his already-shaky standing among women. He admitted it was a mistake to have retweeted an unflattering photo of Mr. Cruz's wife Heidi. And he offered contradictory responses to questions about the sensitive abortion rights issue.
He seemed to be trying to lessen the damage by bringing his wife, Melania, onto the campaign trail on the eve of theWisconsin primary.
Yet his mistakes helped Mr. Cruz pick up the endorsement of the National Right to Life Committee, the leading national antiabortion rights group.
After a vote Saturday by its board of directors, the group said: "Sen. Cruz is the only candidate for president who has always been pro-life, who has a 100% pro-life voting record with National Right to Life, who can win the Republican nomination, and who can defeat pro-abortion Hillary Clinton in November."
In an MSNBC interview Tuesday, Mr. Trump denied the week has reflected badly on his support for women. "As far as women are concerned, nobody respects women more than I do, not even close," he said.
--Beth Reinhard contributed to this article.
Write to Janet Hook at firstname.lastname@example.org and Reid J. Epstein at Reid.Epstein@wsj.com
Continue Reading Below