DIXVILLE, N.H. -- Bernie Sanders and John Kasich picked up the most votes as the first ballots of the first-in-the-nation primary were cast early Tuesday.

Sanders won over all four Democratic voters in the tiny town of Dixville, while Kasich sneaked past Donald Trump, 3-2, among Republicans.

The Kasich campaign says the Ohio governor's "march to the White House began tonight in Dixville Notch," adding that he "called each of Dixville Notch's voters to personally ask them for their support."

Get Breaking News Delivered to Your Inbox

Under New Hampshire state law, communities with fewer than 100 voters can get permission to open their polls at midnight and close them as soon as all registered voters have cast their ballots. While that happened in three locations, Dixville traditionally gets most of the spotlight due to its media-friendly setup at the Balsams Grand Resort Hotel. The other two were Hart's Location and Millsfield.

Results of the nine votes cast shortly after midnight in Dixville Notch, New Hampshire are displayed on February 9, 2016 REUTERS

State law requires polls to be open between 11 a.m. and 7 p.m. Tuesday, but each town and city sets its own hours. Most allow voting between 8 a.m. and 7 p.m., with a handful opening polls as early as 6 a.m. and about 20 remaining open until 8 p.m.

Secretary of State Bill Gardner has said he expects the total number of ballots cast to top records set in 2008, the last time both sides had contested races. That year, just over 241,000 ballots were cast in the GOP primary and just under 289,000 in the Democratic primary, which amounted to nearly 60 percent of registered voters.

He's predicting 282,000 Republican ballots will be cast Tuesday and 268,000 Democratic ballots.

Independent voters, officially known as "undeclared," can vote in either primary, and can revert back to undeclared status immediately afterward.

A woman waits to cast her ballot the first US presidential primary at the town hall in Canterbury, New Hampshire, on February 9, 2016.New Hampshire began voting on February 9 in the first US presidential primary with Republican Donald Trump calling on supporters to propel him to victory and Democrat Bernie Sanders primed to upstage Hillary Clinton. The northeastern state, home to just 1.3 million people, sets the tone for the primaries and could shake out a crowded Republican field of candidates pitting Trump and arch-conservative Senator Ted Cruz against more establishment candidates led by Senator Marco Rubio. Jewel Samad/AFP/Getty Images

Much of the state saw very little precipitation until a pair of storms in the final days before the primary, including one Monday that made for a lot of slipping and sliding in southern and eastern New Hampshire. Only flurries were forecast for Tuesday, so voters weren't likely to have any problem getting to the polls.

Dixville, located about 20 miles from the Canadian border, exists as a town only for voting purposes. Almost all of its nine voters are employees of the hotel, which closed in 2011 but is currently undergoing a major overhaul under new owners.

Former owner Neil Tillotson started the midnight voting tradition in 1960, likely at the suggestion of a news photographer looking for an advantage in getting his pictures out to newspapers ahead of his rivals. For many years, voters cast their ballots in individual booths in the hotel's posh ballot room. Because of the renovations, the nine current residents voted in another building on the property, the Hale House.

In 2012, there was a tie for first place on the Republican side, with Mitt Romney and Jon Huntsman getting two votes apiece. All three Democrats voted for President Obama.

Hart's Location, about 80 miles south of Dixville, first hosted midnight voting in 1948 but gave it up after the 1964 election when residents grew weary of the late hours and media frenzy every four years. Energized with new blood, town residents revived the tradition in 1996, and this year, the town has 41 registered voters.

The New Hampshire Union Leader reports Kasich also squeaked by Trump there, 5 votes to 4, with Chris Christie getting 2 votes, and Jeb Bush, Marco Rubio and Ben Carson one vote each.

The newspaper says Sanders got 12 votes in Hart's Location and Hillary Clinton 7.

Millsfield is also making a comeback this year, though it's unclear just when the town last voted at midnight or when its tradition started. According to a 1952 article in Time magazine, eight residents voted at midnight during the general election that year. This year, there are 22 registered voters.

The Union Leader says Clinton got 2 votes there to Sanders' one, but on the Republican side, Ted Cruz won easily with 9 votes, compared to Trump with 3 and Bush, Christie, Kasich, Rubio, Carly Fiorina and Rand Paul , who suspended his campaign after Iowa, with a vote apeice.