Senator Ted Cruz has beaten billionaire Donald Trump in Iowa's presidential nominating contest, dealing a big upset to the national front-runner in the race to be the Republican Party's White House nominee in 2016.
Mr Cruz, a conservative lawmaker from Texas, won with 28 percent of the vote compared to 24 percent for Mr Trump.
Marco Rubio, a senator from Florida, came in third place with 23 percent.
Votes in the Democratic race are still being counted, and some US media have declared it a dead heat.
With 95 percent of results confirmed, Hillary Clinton clung to the narrowest of leads over Bernie Sanders and told supporters she was "breathing a sigh of relief".
The former secretary of state and first lady stopped short of declaring victory, and her rival, a 74-year-old senator from Vermont, said it was a "virtual tie".
The third Democratic candidate, Martin O'Malley, planned to suspend his campaign, according to the BBC and Reuters.
Republican candidate Mike Huckabee, who won the Iowa caucus in 2008, said on Twitter he would also suspend his campaign.
I am officially suspending my campaign. Thank you for all your loyal support. #ImWithHucK
— Gov. Mike Huckabee (@GovMikeHuckabee) February 2, 2016
Mr Cruz's win and Mr Rubio's strong showing could dent the momentum for Mr Trump, whose candidacy has alarmed the Republican establishment and been marked by controversies such as his calls for a temporary ban on Muslims entering the US.
"Tonight is a victory for courageous conservatives across Iowa and all across this great nation," Mr Cruz said.
The results showed the party's nominee would not be chosen by the media, the Washington establishment or lobbyists, he added.
Mr Trump said he was "honoured" by his second-place finish and congratulated Mr Cruz.
He looked forward to the next contest next week in New Hampshire, where polls showed him ahead, he said.
Mr Rubio said he was "grateful" to Iowan voters, who had believed in him when "others didn't think it was possible".
The results could have ramifications in upcoming races.
"There is now blood in the water for Donald Trump," Republican strategist Ron Bonjean said.
"Ted Cruz proved he could successfully beat back Trump attacks because he had a great ground game and identified well with evangelical voters."
Iowa has held the country's first presidential nominating contests since the early 1970s, giving it extra weight in the electoral process that can translate into momentum for winning candidates.
The voter gatherings, called caucuses, take place in 1100 schools, churches and other public locations across the Midwestern state.
- Reuters / BBC