MILWAUKEE -- Republican Ted Cruz captured a crucial victory Tuesday in the Wisconsin primary, a significant step in his efforts to block front-runner Donald Trump's path to the presidential nomination and push the Republican contest toward a rare convention fight. In the Democratic race, Bernie Sanders defeated front-runner Hillary Clinton, giving him a burst of momentum but barely denting his rival's delegate lead.

Trump's defeat came amid one of his worst periods of his campaign, a brutal stretch that highlighted his weaknesses with women and raised questions about his policy depth. While the billionaire businessman still leads the Republican field, Cruz and other anti-Trump forces hope Wisconsin marks a turning point in the chaotic Republican nominating contest.

Exit polls in the state underscored the concerns about Trump that are surging through some corners of the Republican Party. Nearly 4 in 10 Republican voters in Wisconsin said they were scared about what Trump would do as president.

For Sanders, Wisconsin was favourable territory, with an overwhelming white electorate and liberal pockets of voters.

Even with his Wisconsin victory, Sanders is unlikely to gain much ground. Because Democrats award delegates proportionally, a narrow victory by either candidate on Tuesday would mean that both Sanders and Clinton would get a similar number of delegates. The primary contests are choosing delegates to the parties' national conventions that will chose the presidential nominees.

Heading into Tuesday's voting, Clinton had 1,243 delegates to Sanders' 980 based on primaries and caucuses. When including superdelegates, the party officials who can back any candidate, Clinton holds a much wider lead -- 1,712 to Sanders' 1,011. It takes 2,383 delegates to win the Democratic nomination.

Clinton's campaign has cast her lead as nearly insurmountable. Yet Sanders' continued presence in the race has become an irritant for the former secretary of state, keeping her from turning her attention to the general election.

According to exit polls, Sanders has excited voters in Wisconsin, with more than half of Democratic primary-goers saying the senator inspires them more about the future of the country. But three-quarters of Democratic voters say Clinton has realistic policies.

The exit polls were conducted by Edison Research for The Associated Press and television networks.

Trump has battled a series of campaign controversies in the lead-up to Wisconsin, including his campaign manager's legal problems following an altercation with a female reporter and his own awkward stumbles in clarifying his views on abortion. Wisconsin's Republican establishment, including Gov. Scott Walker, has also campaigned aggressively against the businessman.

Still, Trump made a spirited final push in the state and predicted a "really, really big victory."

Complicating the primary landscape for both Cruz and Trump is the continuing candidacy of John Kasich. The Ohio governor's only victory has come in his home state, but he's still picking up delegates that would otherwise help Trump inch closer to the nomination or help Cruz catch up.

If Cruz wins all of Wisconsin's 42 delegates, Trump would need to win 57 per cent of those remaining to clinch the Republican nomination before the July convention. So far, Trump has won 48 per cent of the delegates awarded.

Heading into Wisconsin, Trump had 737 delegates to Cruz's 475, with Kasich trailing with 143.

To win a prolonged convention fight, a candidate would need support from the individuals selected as delegates. The process of selecting those delegates is tedious, and will test the mettle of Trump's slim campaign operation.

Cruz prevailed in an early organizational test in North Dakota, scooping up endorsements from delegates who were selected at the party's state convention over the weekend. While all 28 of the state's delegates go to the national convention as free agents, 10 said in interviews that they were committed to Cruz. None has so far endorsed Trump.

Despite the concern among some Wisconsin Republicans about Trump becoming president, nearly 6 in 10 Republican voters there said the party should nominate the candidate with the most support in the primaries, which so far would be Trump. Even among voters who favoured Cruz, 4 in 10 said the candidate with the most support going into the convention should be the party's nominee.

Among Democrats, Sanders, a self-declared democratic socialist, has taken his dark-horse candidacy from a mere annoyance to Clinton to a serious challenge for the former secretary of state, who had largely been expected to take the Democrat nomination in a walk when the contest began last year.

Sanders would need to win 67 per cent of the remaining delegates and uncommitted superdelegates to catch up to Clinton. So far, he's winning 37 per cent.

------

Associated Press writers Steven R. Hurst, Julie Pace and Scott Bauer contributed to this report.