Mitt Romney, the former Massachusetts governor, has won the Iowa Republican presidential caucuses by a narrow margin of votes over former Pennsylvania senator Rick Santorum.
He also won the endorsement of John McCain, the Arizona senator who lost the White House race to President Barack Obama in 2008.
"I'm really here for one reason and one reason only, and that is to make sure that we make Mitt Romney the next president of the United States of America," the Republican lawmaker told cheering supporters in a high school gymnasium in New Hampshire.
Romney edged out Santorum by only eight votes, winning by 30,015 to 30,007, Republican Party officials in the midwestern state announced on Wednesday.
Michele Bachmann ended her bid to win the Republican presidential nomination on Wednesday after coming in last.
Even so, the Minnesota congresswoman said: "President Obama and his socialist policies must be stopped" and added that she was certain the country's founders were "watching" her.
The result will solidify Romney's front-runner status, as the Republicans head for their next contest in his stronghold of New Hampshire.
Iowa caucuses were the first contest in the state-by-state battle for the Republican presidential nomination to face the sitting Democratic president, Barack Obama, on November 6.
Both candidates were locked in a neck-and-neck fight till the end at 25 per cent votes. Ron Paul, a Texas congressman, claimed third place with 21 per cent of the vote.
Sixty-four-year-old Romney is a former governor of Massachusetts. He is a strong supporter of the military and advocates boosting troop numbers.
Romney said he and Santorum each had "a great victory" and congratulated Paul, then attacked Obama, saying: "This has been a failed presidency."
Fifty three-year-old Santorum has gone from outsider to one of the leading candidates in Iowa.
Elected to the senate in 1994, Santorum is a fierce opponent of abortion and gay rights. He would push to ban same-sex marriage and penalise employers who hire illegal immigrants.
Speaking to Al Jazeera, John Nichols, a political writer for The Nation magazine, said: "I don’t think one would write Santorum off as uncompetitive. He could be a serious contender.
"But to get there, he is going to have to work his way through a really intense Republican primary process.
"And that will be test if he can beat Romney, which is an uphill race. I think he can come into contest with Obama as something like a giant killer may be junior Ronald Reagan. But he has still to beat Romney."
Paul's unorthodox views, including supporting a return to the gold standard and an end to a US overseas military presence, have won him a passionate following among voters who feel deeply alienated from more mainstream candidates.
"This movement is going to continue and we're going to keep scoring just as we have tonight," he said.
Newt Gingrich, the former US House of Representatives speaker, got 13 per cent votes,
Rick Perry, the Texas governor, collected 10 per cent of votes, while Michelle Bachmann, the Minnesota congresswoman, could manage only five per cent.
The seventh candidate, Jon Huntsman, a former Utah governor, did not campaign in Iowa.
Perry, who was relegated to fifth position, said he "will return to his home state of Texas to assess presidential bid".
Earlier, voters cast the first ballots in the 2012 White House race to pick their nominee for the Republican candidate to take on President Barack Obama.
Iowans from 1,774 precincts assembled in school gymnasiums, cafeterias and church basements to hear speeches from their neighbours on behalf of the seven candidates before voting.
Potential big boost
Iowa's caucuses are known more for weeding out candidates than picking the future president, and finishing in one of the top spots could provide a big boost to any contender in the contest to pick a candidate for the November 6 oresidential election.
"You can't win the presidential nomination here in Iowa, but you can lose it," Al Jazeera's Alan Fisher reported from Des Moines in Iowa.
"What happens here will shape the agenda of the Republican Party as they go next to New Hampshire and then South Carolina."
The tight Republican race, marked by ups and downs in opinion polls for most of the candidates, has been marked by weeks of negative campaigning.
Santorum has gained ground, playing heavily on his conservative Christian, anti-abortion record with like-minded Republican voters in the heartland state, which is largely farmland and more than 91 per cent white.
But with little cash and a bare-bones campaign operation, he could have difficulty competing in other states.
With plenty of cash and a strong campaign infrastructure, Romney is likely to emerge from Iowa in a much stronger position than his rivals.
A favourite of the party's business wing, Romney holds a commanding lead in the next nominating contest in New Hampshire in one week and has the resources to compete in bigger states like Florida at the end of the month.
Twenty-five delegates were at stake in Iowa, out of 1,144 needed to win the Republican nomination in August. The delegates are not assigned until the state Republican convention on June 16.
Obama is vulnerable because of the struggling American economy and continuing high unemployment. The US has been slow to rebound from the recession of 2007 to 2009.