Texas Senator Ted Cruz has won the Iowa Republican caucuses ahead of businessman Donald Trump and Florida Senator Marco Rubio.

Mr Rubio came a close third after performing far better than expected, and making the Republican battle a three-horse race.

A conservative lawmaker from Texas, Mr Cruz won the first state Republican contest with 28% of the vote compared to 24% for businessman Mr Trump.

Mr Rubio, a US senator from Florida, came in third with 23%, making a stronger-than-expected finish.

On the Democratic side, officials said former secretary of state Hillary Clinton had won by a razor-thin margin against US senator Bernie Sanders of Vermont, the closest in Iowa Democratic caucus history.

Ms Clinton took 49.9% of the votes while Mr Sanders had 49.6%.

The other Democratic White House hopeful Martin O'Malley, the Irish-American former Governor of Baltimore, has suspended his campaign after garnering just 0.5% in the caucus.

On the Republican side, former Arkansas Governor Mike Huckabee tweeted that he too would suspend his campaign.

"Tonight, is a victory for the grassroots," Mr Cruz, the arch conservative senator from Texas, told supporters after the vote.

"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. Will not be chosen by the lobbyists. 

"But will be chosen by the most incredible, powerful force where all sovereignty resides in our nation, by we, the people, the American people."

Addressing supporters after the Democratic vote, Ms Clinton made no direct comment on the result, saying only that she looked forward to a "real contest of ideas" with her rival.

But Mr Sanders was jubilant as he took the stage in a packed hotel ballroom close to Des Moines airport, where enthusiastic supporters waved signs saying "A future to believe in" and chanting "Bernie! Bernie!"

The result further strengthens Mr Sanders' hand in the upcoming contest in New Hampshire, which neighbours his Vermont constituency.

"The reason that we have done so well here in Iowa, the reason I believe we're going to do so well in New Hampshire, and in the other states that follow, the reason is, the American people are saying, no to a rigged economy," Mr Sanders told the crowd.

"We do not represent the interests of the billionaire class, Wall Street or corporate America," said the self-proclaimed Democratic Socialist.

The vote in Iowa is being followed in the weeks ahead by more ballots in the 49 other states.

The next contest will be in New Hampshire a week today on 9 February.

The Iowa results are seen as significant because victory can boost campaign momentum in other states.

The Republican and Democratic party nominees will be chosen by the summer, and US voters will pick current president Barack Obama's successor in November.