Media playback is unsupported on your device Media caption Three things to look for in New Hampshire results

Polls have closed in the New Hampshire primary, where voters are selecting Republican and Democratic candidates for the US presidential race.

State officials have predicted a historic turnout, with more than half a million people coming out to vote.

Republican Donald Trump and Democrat Bernie Sanders are favourites to win their respective parties' races.

New Hampshire is the second major test after Ted Cruz and Hillary Clinton won the Iowa caucuses last week.

Opinion surveys conducted before the vote suggest Mr Trump is the Republican frontrunner, leaving Senator Cruz, Marco Rubio, John Kasich, Chris Christie and Jeb Bush to vie for second place.

On the Democratic side, a large victory was predicted for Vermont Senator Bernie Sanders over former Secretary of State Hillary Clinton.

Most polls closed at 19:00 local time (midnight GMT), though some are to remain open for an extra hour.

Votes are already being counted and results are expected in the next few hours.

Counting the votes

Live results as they are counted

Latest news and reaction

The tiny town of Dixville Notch cast the first votes at midnight on Tuesday, favouring Bernie Sanders and John Kasich.

Under New Hampshire state law, towns with populations of under 100 can apply to cast their vote as the clock strikes midnight and close the polling station as soon as everyone has voted.

Of the handful of voters in Dixville Notch in the early hours, four Democrats chose Mr Sanders, while of the Republicans two picked Donald Trump and three went for Ohio Governor John Kasich.

Mr Sanders, a senator from neighbouring Vermont and a self-proclaimed "Democratic socialist", is hoping for a victory in New Hampshire over Hillary Clinton.

Mrs Clinton, who has more support from the Democratic establishment, narrowly won in Iowa.

Image copyright Reuters Image caption Donald Trump was one of the candidates in the state on Tuesday to drum up last-minute support

Image copyright AP Image caption Turnout in the Republican race could be at record levels

Image copyright Reuters Image caption The leading candidates in Dixville Notch will be hoping to replicate their early success on a bigger scale later on Tuesday

"For those of you who are still deciding, still shopping, I hope I can close the deal," she said at a campaign event in Manchester on Monday.

Meanwhile Mr Sanders told cheering supporters: "We have come a long way in the last nine months. There is nothing, nothing, nothing that we cannot accomplish.''

The Republican race has been particularly fractious. Several candidates tore into Florida Senator Marco Rubio - who came a strong third in Iowa - during a televised debate at the weekend.

New Jersey Governor Chris Christie accused Mr Rubio of being inexperienced and scripted. "You have not been involved in a consequential decision," he said.

What are primaries and caucuses?

They are the first contests in the US presidential race in which states decide who becomes each party's official candidate

Caucuses are a series of private meetings in which voters express support for candidates with a show of hands. Usually only registered voters, affiliated with a specific party, can take part

Primaries are run by state governments and voting is done in a secret ballot

Each primary or caucus earns delegates for the winning candidates who then vote for them at party conventions in July in which the final candidates are formally confirmed

How primaries and caucuses work

How the US elects its president

Rubio feels the heat

Hillary Clinton's problem with young women

Bloomberg eyes entering race

Mr Rubio was also assailed by billionaire Donald Trump and former Florida Governor Jeb Bush.

On Monday Mr Trump repeated his pledge to strengthen harsh interrogation technique to terrorism suspects, vowing to bring back waterboarding and "a hell of a lot worse".

Mr Cruz, an evangelical conservative from Texas who like Mr Trump is running on an anti-establishment platform, has called his win in the Iowa caucuses a "victory for the grassroots".

Several of the seven Republicans on stage have staked much on New Hampshire, analysts say.

Image copyright Getty Images Image caption The Seven Republican candidates clashed in a testy debate on Saturday

Despite its small size, the state's place in the primary season gives it special importance as candidates try to build an early momentum.

Over the coming months each US state will pick delegates who pledge to endorse a candidate at their party's convention in July. The victor on each side will compete in the November presidential election.