Donald Trump: "I love the people of Iowa"
Texas Senator Ted Cruz has won the Iowa Republican caucuses, the first vote to choose US presidential candidates.
"Tonight is a victory for courageous conservatives," he declared, to great applause, as he railed against Washington, lobbyists and the media.
He took 28% of the Republican vote, beating his rival, the frontrunner Donald Trump, and Marco Rubio.
Votes in the Democratic race are still being counted, with Hillary Clinton's camp saying they have narrowly won.
The aim of the primary and caucus races in the coming months is to determine which candidates will stand for the two main parties in the November presidential election.
Republican vote, 99% reported:
Democratic vote, 99% reported:
Her campaign director in Iowa, Matt Paul, said there was "no uncertainty" that the former secretary of state and first lady had beaten Bernie Sanders, a 74-year-old senator from Vermont.
In five precincts the vote was decided by the toss of a coin - all going to Mrs Clinton,according to the Des Moines Register.
Mr Sanders said it was a "virtual tie" and before leaving for New Hampshire, which is holding party primaries on Tuesday, Mrs Clinton told her supporters she was "breathing a sigh of relief".
Ted Cruz arrives
Hillary Clinton ekes out narrow victory against Bernie Sanders in Iowa?
There was no such ambiguity from Republican victor Mr Cruz, whose triumph was reward for months spent criss-crossing the state to woo influential conservative and evangelical leaders.
As country music blared at his Des Moines rally, the 45-year-old conservative, who is disliked by the Republican party leadership, relished his victory.
"Iowa has sent notice that the Republican nominee and the next president of the United States will not be chosen by the media, will not be chosen by the Washington establishment," he said.
In the end it was a victory for organisation over enthusiasm. Despite trailing Donald Trump in the polls for much of the last two weeks, Ted Cruz swept to a comfortable win in Iowa.
During his victory speech, he repeatedly thanked his grass-roots support - and for good reason. He and his campaign had invested considerable time and money to grind out a victory in this key state, and they were ultimately rewarded for their efforts.
With this result Mr Cruz now has the momentum to survive what looks to be an uphill battle among the more moderate voters in New Hampshire, and then win over the deeply conservative, evangelical voters of Southern states that dominate the primary calendar in the following weeks.
It appears increasingly likely that a showdown for Mr Cruz looms on the horizon with the surprise third-place finisher in Iowa, Senator Marco Rubio. And Mr Trump - even if his supporters did not turn out in the numbers expected - will surely remain a factor.
Bernie Sanders watches a broadcast of the caucus in his hotel room prior to a caucus night party in Des Moines, Iowa Photo: 2016 Getty Images
Mr Trump congratulated the Texas senator and said he was "honoured" by the second-place finish.
Mr Rubio, who has struggled to gain support in recent months, has performed far better than expected, and finished just one percentage point behind Mr Trump.
Meanwhile, two candidates are bowing out.
Sources close to Democrat Martin O'Malley, former Maryland governor, have told the BBC that he will suspend his campaign - narrowing the field to two competitive candidates.
On the Republican side, Former Arkansas Governor Mike Huckabee tweeted that he too would suspend his campaign.
Iowa has an unusual election system based on caucuses, which involve people gathering at private homes, schools and other public buildings across the state.
Democratic voters divide themselves into groups based on their preferred candidate, but the Republican caucus process is more like a traditional ballot.