Pete Buttigieg and Bernie Sanders are nearly tied in the US state of Iowa's Democratic caucuses, with nearly all results counted in a contest marred by technical issues and reporting delays.

The race remained too early to call early on Thursday with 97 percent of precincts reporting. Party officials were scrambling to verify the remaining results three days after Iowans gathered at caucus sites across the state to begin choosing which Democrat will take on President Donald Trump in November.

More:

A new batch of results released just after midnight narrowed the margin between Buttigieg, the former mayor of South Bend, Indiana, and Sanders, the progressive senator from Vermont. Buttigieg has a lead of three state delegate equivalents out of 2,098 counted.

The deadlocked contest gives both Buttigieg and Sanders a burst of momentum as they seek to pull away from the crowded field. The nearly complete results show them leading Senator Elizabeth Warren, with former Vice President Joe Biden and Senator Amy Klobuchar trailing behind.

Delays and more delays

But the results in Iowa were muddied by the stunning breakdown of the caucus reporting process in a state that traditionally kicks off presidential nominating contests. Iowa officials initially attributed a delay in reporting results to technical problems with an app that precinct chairs were supposed to use to record votes, then to backlogs as those volunteers tried to call the party to submit their totals.

Even as the total number of results ticked up throughout the day on Wednesday, obstacles remained. Some tally sheets were making their way to party headquarters in Des Moines through the mail, which contributed to the delay.

Much of the political world has already shifted its attention to next-up New Hampshire, which holds the first primary election in the Democrats' 2020 nomination fight on Tuesday. Both Buttigieg and Sanders are leading contenders there, as well.

A precinct worker tallies Iowa Democratic caucus votes by hand on paper as caucus results are manually counted after a Democratic presidential caucus at West Des Moines Christian Church in West Des Moines, Iowa [Jim Bourg/Reuters]

The two men are separated by 40 years in age and conflicting ideologies.

Sanders, a 78-year-old self-described democratic socialist, has been a progressive powerhouse for decades. Buttigieg, a 38-year-old former municipal official, represents the more moderate wing of the Democratic Party. Buttigieg is also the first openly gay candidate to earn presidential primary delegates.

Their strength in Iowa put them in the crosshairs of rivals as the race shifted to New Hampshire. Biden, who fell far short of expectations in Iowa, cast both Buttigieg and Sanders as risky choices for Democrats, given the former mayor's relative inexperience and the senator's descriptions of himself as a socialist.

Sanders is making his second run for the White House. He surprised many Democrats in 2016 with his strong challenge to Hillary Clinton, but entered the 2020 contest as a frontrunner. He has topped the field in fundraising despite eschewing high-dollar donors.

Precinct captain Carl Voss of Des Moines displays the Iowa Democratic Party caucus reporting app on his phone outside the Iowa Democratic Party headquarters in Des Moines [Nati Harnik/AP Photo]

Sanders and his supporters raised issues with the primary process after the 2016 election, prompting the Democratic National Committee to make changes that affected the Iowa reporting regulations.

As a result, Iowa released three sets of data from the caucuses: the tally of voter preferences at the start of the caucus; their preferences after supporters of candidates who reached less than 15 percent made a second choice; and the results of state delegate equivalents.

The final alignment results are used to determine state delegate equivalents, which is the metric the AP news agency has long used to call the winner of the caucus. Democrats pick their nominee based on delegate totals.

With 97 percent of precincts reporting, Sanders is leading in the first alignment results and has a narrower edge in the final alignment.