DES MOINES, IOWA - Texas Senator Ted Cruz was the winner of the Iowa Republican presidential caucus, the first official test of the 2016 U.S. presidential campaign. But the Democratic race between Hillary Clinton and challenger Bernie Sanders ended in a virtual tie, suggesting a long primary battle to come.

Cruz bested Republican rivals, billionaire real estate mogul Donald Trump and Florida Senator Marco Rubio, who made a strong showing that could pay dividends down the line.

Cruz, an anti-Washington conservative, emerged from a crowded Republican field to claim victory.

Republican presidential candidate Senator Ted Cruz
Republican presidential candidate Senator Ted Cruz of Texas speaks during a caucus night rally, in Des Moines, Iowa, Feb. 1, 2016.

?Tonight, is a victory for the grass roots. Tonight is a victory for courageous conservatives across Iowa and all across this great nation. Tonight, the state of Iowa has spoken," Cruz said at a rally in Des Moines following his win.

Second place

Trump, leading the race for months, finished a close second to Cruz and moves on to the next contest in New Hampshire promising victory.

?We will go on to get the republican nomination we will go on to easily beat Hillary or Bernie or whoever the hell they throw up there!? he told his supporters at a rally in West Des Moines, Iowa.

Florida Senator Marco Rubio finished third, surprisingly close to Trump, emerging perhaps as the favorite of establishment Republicans.

?Tonight, here in Iowa, the people of this state have sent a very clear message. After seven years of Barack Obama, we are not waiting any longer to take our country back!? Rubio said.

Republican turnout hit a record high. Among the attendees in West Des Moines was Sheila Waller, a Rubio supporter.

?I think he is extremely well spoken, very well educated and very smart on foreign policy and I think that is something that sort of hits everyone," Waller said.

Close vote

The Democratic race was extremely close with Clinton and Sanders in a virtual dead heat. But Clinton treated it as a victory.

Democratic presidential candidate Hillary Clinton,
Democratic presidential candidate Hillary Clinton, accompanied by her husband, former President Bill Clinton, arrives at her caucus night rally at Drake University in Des Moines, Iowa, Feb. 1, 2016.

"Wow, what a night, an unbelievable night. What a great campaign. This has been an incredible honor to campaign across Iowa with so many of you, to make the case for the kind of future we want for the Democratic Party and for the United States of America," she said.

Sanders also claimed victory, surrounded by young voters who have embraced his message on the economy. He is eager to move on to New Hampshire where he has a sizable lead in the latest polls over Clinton.

?Given the enormous crisis facing our country, it is just too late for establishment politics and establishment economics," Sanders told his supporters.

Eager to vote

Democrats also turned out in force, eager to vote.

?He is the breath of fresh air in the political process," said Amelia Mohr, a Sanders supporter.

?I think she?ll be the strongest candidate to follow the suit of Obama and to be able to work with Congress moving forward," said Randy Kane, a Clinton supporter.

Democrat Martin O'Malley and Republican Mike Huckabee suspended their campaigns after poor showings. The remaining candidates head on to New Hampshire for next Tuesday's primary.

View full gallery