MANCHESTER, N.H. (AP) -- Republican Donald Trump and Democrat Bernie Sanders swept to victory in Tuesday's New Hampshire primaries, adding crucial credibility to their upstart candidacies and underscoring voters' insistence on shaking up American politics.

Trump and Sanders entered Tuesday's contest as favorites in New Hampshire, but needed to deliver on expectations after second-place finishes in Iowa's leadoff caucuses. Trump appealed to voters seeking a political outsider, while Sanders was buoyed by those seeking a candidate who they felt cared about people like them.

"Together we have sent the message that will echo from Wall Street to Washington, from Maine to California," Sanders said at a raucous victory party. "And that is that the government of our great country belongs to all of the people and not just a handful of wealthy campaign contributors and their super PACs."

Hillary Clinton echoed Sanders' calls for taking on Wall Street banks and tackling income inequality, but cast herself as more prepared to make good on her policy pledges. "People have every right to be angry. But they're also hungry, they're hungry for solutions," she said after congratulating Sanders on his win.

New Hampshire did little to clarify the crowded contest among more mainstream GOP candidates fighting to emerge as a challenger to Trump and Texas Sen. Ted Cruz, who won the Iowa caucuses. Ohio Gov. John Kasich claimed second place after devoting almost all of his campaign resources to New Hampshire, while Florida Sen. Marco Rubio and former Florida Gov. Jeb Bush battled for third, along with Cruz.

New Jersey Gov. Chris Christie, who also staked his candidacy on New Hampshire, lagged behind the pack as votes were being tallied.

Sanders pulled from a broad coalition of New Hampshire voters, gathering a majority of votes from men, independents and voters under 45, as well as a slim majority of women. Hillary Clinton won the majority of those over 65 and those with incomes over $200,000 a year, according to early exit polls conducted by Edison Research for The Associated Press and the television networks.

Clinton's campaign argues she will perform better as the race heads to more racially diverse states, including Nevada and South Carolina. Both New Hampshire and Iowa are overwhelmingly white states that are far less diverse than the nation as a whole.

The distinctions between what motived Sanders and Clinton voters were sharp. The Vermont senator was backed by 9 in 10 voters for whom honesty was important and 8 in 10 who wanted a candidate who "cares about people like me." Clinton, meanwhile, won support from nearly 90 percent of those who considered the "right" experience important in their decision and about 80 percent of those regarding electability as the most important factor.

Both Sanders, a self-described democratic socialist, and Trump, a real estate mogul who has never held political office, have tapped into the public's frustration with the current political system. Even if neither candidate ultimately becomes his party's nominee, whoever does will have to reckon with those factions of voters.

Republican voters were more negative about their politicians than Democrats, with about half of GOP voters saying they felt betrayed by party officials. Trump carried a majority of those who said they wanted an outsider to win.

Nearly half of voters in the Republican primary made up their minds in the past week. However, Trump's support appeared more sustained, with his supporters saying they made up their minds some time ago.

In a sign of Trump's impact on the race, two-thirds of GOP voters said they supported a temporary ban on non-citizen Muslims entering the U.S., a position the billionaire outlined last year amid rising fears of terrorism emanating from the Middle East.

After finishing behind Cruz in Iowa last week, Trump embraced some of the more traditional trappings of presidential campaigns, including smaller town hall events with voters. Still, he closed the final full day of campaigning with a vulgar insult of Cruz.

The Texas senator brushed off Trump's comments, saying the reason the businessman engages in insults "is because he can't discuss the substance."

The large Republican field was winnowed after Iowa, but there remains a crowded grouping of more traditional candidates, including Rubio and the governors.

Rubio had appeared to be breaking away after a stronger-than-expected showing in Iowa, but he stumbled in Saturday's debate under intense pressure from Christie. The New Jersey governor has relentlessly cast the young senator as too inexperienced and too reliant on memorized talking points to become president.

Rubio played into Christie's hands by responding with the same well-rehearsed line each time he was challenged by the governor. Rival campaigns hoped the moment was enough to give voters pause.

Kasich, Bush and Christie all poured enormous resources into New Hampshire in hope of jumpstarting their White House bids in a state that has been friendly to moderate Republicans. All three could face pressure from party leaders and financial donors to end their campaigns without a strong showing.

----

Pace reported from Washington. AP writers Lisa Lerer, Ken Thomas, Holly Ramer, Steve Peoples, Julie Bykowicz and AP News Survey Specialist Emily Swanson contributed to this report.