Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Sen. Ted Cruz bested billionaire Donald Trump to win Iowa's Republican caucuses Monday night as Democratic presidential hopeful Hillary Clinton eked out a victory in a historically close race.

With just one precinct yet to declare, NBC News has declared Clinton the apparent winner based on a report from the Iowa Democratic Party showing her narrowly ahead of Sen. Bernie Sanders.

"Tonight we saw an historically close Iowa Democratic Caucus," the party said in a statement shortly before 4 a.m. ET.

NBC News has allocated 21 of the 52 available national delegates to Clinton and 20 to Sanders as of 2:37 a.m. EST.

The Iowa Democratic Party said Clinton has been awarded 699.57 state delegate equivalents while Sanders has been awarded 695.49.

The Republican Race

Despite polling that suggested that he was slipping behind Trump in Iowa, Cruz commanded the field Monday night.

The Texas senator garnered the support of 28 percent caucus goers, a significant win in a field of a dozen candidates splitting the vote. Trump finished a disappointing second place, four points behind Cruz.

Florida Sen. Marco Rubio had a surprisingly strong showing, coming in a close third place with 23 percent and performing better than polls had suggested.

The rest of the Republican field trailed further behind.

A total of thirty delegates are awarded in Iowa's Republican race, a fraction of the amount necessary to clinch the nomination. NBC News is allocating Cruz eight, Rubio and Trump seven, former pediatric neurosurgeon Ben Carson three, Kentucky Sen. Rand Paul and former Florida Governor Jeb Bush one delegate each.

Iowa Caucus Full Results

Trump, who usually spends a good chunk of his stump speech bragging about his dominance in the polls, conceded defeat in Iowa but sounded optimistic for what lies ahead.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"We finished second," he said. "We're leaving tonight and tomorrow afternoon we'll be in New Hampshire and that will be something special. It's going to be a great week.... I think we're going to be proclaiming victory I hope."

Cruz competed fiercely in the state, where a majority of caucus-goers identify as evangelical — a constituency that appreciated the Texan's conservative social beliefs. It paid off. He showed significant support — 43 percent — among self-identified conservatives and evangelicals — 33 percent. More than one-third of caucus-goers who want a candidate who shares their values backed Cruz.

"Tonight is a victory for every American," he said. "To the revolutionary understanding that all men and all women are created equal that our rights do not come from the Democratic Party or the Republican Party of even the Tea Party. Our rights come from our creator."

Cruz's organizational efforts also helped the candidate secure his victory. He won among voters who were contacted by a candidate.

Photos: Iowa Caucus Night

Turnout for the Republican caucus surpassed previous records. At least 186,000 people caucused, far surpassing the 121,000 people who caucused four years ago. High turnout was supposed to help Trump who was attracting lower-propensity voters to his rallies.

Rubio, meanwhile, was thrilled at his performance, telling supporters Monday night. "When I am our nominee we are going to unify this party and ... the conservative movement."

He addressed detractors, saying, "They told us we got no chance because my hair wasn't grey enough and that my boots were too high. They told me I had to wait my turn in line."

The Democratic Race

While the Republican candidates were able to address the results and head for New Hampshire, the Democratic race was far from clear cut.

In remarks to their supporters in Iowa, Clinton stopped short of declaring victory as Sanders welcomed the "virtual tie" heading into Tuesday morning.

"What a night. An unbelievable night. What a great campaign," Clinton said with her husband former President BIll Clinton and her daughter Chelsea by her side. "So as I stand here tonight, breathing a big sigh of relief."

For Sanders, who started his campaign in the single digits in the polls compared to Clinton's high support that registered in the high 60s, the closeness of the race is a victory. The tone of his address to supporters suggested as much.

"We had no money, we had no name recognition, and we were taking on the most powerful political organization in America," he said.

The Iowa Democratic Party released a statement with state delegate results before dawn on Tuesday, saying the "historically close" caucus featured one of the "strongest turnouts ever."

Clinton's campaign responded almost immediately to welcome the victory.

"Hillary Clinton has won the Iowa Caucus," the campaign said in a statement. "After thorough reporting and analysis, there is no uncertainty and Secretary Clinton has clearly won."

After landing in New Hampshire, Sanders brushed aside a question about whether he would contest the close Iowa result.

“Honestly we just got off the plane, we don’t know enough to say anything about it,” he told reporters. “We look forward to doing well here in New Hampshire. And after that we’re off to Nevada and then South Carolina where I think we’re going to surprise a whole lot of people, just as we did in Iowa.”

Bernie Sanders not yet sure he won't contest Iowa result, said (understandably) he just got off plane (no wifi) https://t.co/oLOHtlup9A -Kasie Hunt (@kasie) February 2, 2016

Leaving the Race

Meanwhile, the crowded field for the presidential nomination narrowed slightly on both sides, with two candidates dropping out of the race on Monday night.

Republican former Arkansas Gov. Mike Huckabee announced via Twitter that he is suspending his campaign. Huckabee was the Iowa caucus winner in 2008, but lost the nomination to Sen. John McCain. He didn't run in 2012, but gave the nomination another shot this cycle. He failed to garner support in a crowded field, with polling in Iowa sitting around two percent. At the end of the fourth quarter, FEC reports show that Huckabee had only $133,000 left in the bank.

I am officially suspending my campaign. Thank you for all your loyal support. #ImWithHucK — Gov. Mike Huckabee (@GovMikeHuckabee) February 2, 2016

Former Maryland Governor Martin O'Malley also suspended his campaign for the Democratic nomination, announcing his decision to supporters shortly after the caucuses began.