She took a wafer-thin margin of 49.9%, against 49.5% for Bernie Sanders
US Democratic hopeful Hillary Clinton had a simple message for her supporters after she claimed the narrowest of victories in the first proper test of her US Presidential campaign.
Mrs Clinton, a former Secretary of State and First Lady, took a wafer-thin margin of 49.9% over 49.5% for Bernie Sanders, a US Senator from Vermont, with 99% of precincts reporting.
In a statement, her campaign claimed she had won the Democratic Iowa caucus - and she tweeted this simple message:
But the outcome in three precincts in the state - Davenport, Des Moines and Ames - was decided by a coin flip, according to the Des Moines Register.
Mr Sanders said the tight contest had given his campaign a "kick-start" and showed the American people that "this is a campaign that can win".
The third Democratic candidate, Martin O'Malley, has suspended his campaign after trailing badly. He gained just 0.6% of Iowa's votes.
The Hillary for America campaign was counting on its vaunted get-out-the-vote operation to deliver a clear victory and avoid a stinging rerun of her 2008 defeat to now-President Barack Obama.
But Mrs Clinton, who has been dogged by an inquiry into her e-mails while she was the top US diplomat, put a brave face on Monday night's inconclusive result.
She said she was "breathing a big sigh of relief" and told the crowd: "I am a progressive who gets things done for people".
With the race too close to call, Mr Sanders - a self-described democratic socialist - told cheering supporters: "What Iowa has begun tonight is a political revolution.
"We are going to create an economy that works for working families, not just the billionaire class".
Mrs Clinton - the party establishment favourite - entered the Democratic race as the runaway leader.
But Mr Sanders has electrified youthful crowds with his impassioned rallying cry to reform an economy he says is rigged in favour of the super-rich.
According to opinion polls, Mr Sanders enjoys a healthy double-digit lead over Mrs Clinton in the second nominating contest, next week's New Hampshire primary.
Two consecutive defeats for Mrs Clinton could set off alarms bells within the party about her ability to defeat a Republican opponent.
Mr Sanders looks likely to face an uphill battle in the other primary contests of February and March.
Critics say his vision of a US with universal healthcare and free college tuition is not feasible.
But he reminded fans he had come to Iowa nine months ago with no money, name recognition or political organisation.
The pair will share the spoils of delegates to the party's national convention in July when the presidential nominee is crowned.
Mrs Clinton is projected to walk away with 22 delegates and Mr Sanders with 21.
On the Republican side in Iowa, Donald Trump conceded defeat to Texas Senator Ted Cruz.
Mr Cruz led the billionaire businessman by 27.6% to 24.3%, with 99% of precincts reporting results in the Midwestern US state.
Florida Senator Marco Rubio, viewed by many Republicans as a more mainstream alternative, nipped at Mr Trump's heels in third place at 23.1%.
Delivering his victory speech in Des Moines, Mr Cruz told supporters: "Tonight is a victory for courageous conservatives across Iowa and across this great nation".
He said the Iowa result was a blow to the "Washington cartel".
His victory comes just four years after he rode a tea party wave to win election to the Senate.
Mr Trump, toning down his trademark bombast, told fans: "We finished second and I just want to say, I'm really honoured and I want to congratulate Ted".
But the real estate billionaire, who had never stood for election before, went on to predict he would still win the Republican nomination.
The race now moves to next week's New Hampshire primary, where Mr Trump has a stronger showing, according to opinion polls.
The crowded Republican field narrowed on Monday night as Mike Huckabee dropped out of the race.
Turnout was huge on both sides for the first-in-the-nation contest to pick candidates for November's US White House elections.
More than 180,000 Republican voters showed up, compared with about 121,000 in 2012.
Mr Cruz gets at least eight delegates, Mr Trump at least seven, Mr Rubio six, two for retired neurosurgeon Ben Carson and at least one for Kentucky Senator Rand Paul.
Eleven Republicans candidates remain in the race after months of rallies, televised debates and tens of millions of dollars of political advertising.