Terence O'Rourke, center, makes a point during a debate for Democratic hopefuls in New Hampshire's 1st Congressional District at the Institute of Politics at St. Anselm College in Manchester, N.H., Wednesday, Sept. 5, 2018. From left are Lincoln Soldati, Paul Cardinal, O'Rourke, Maura Sullivan and Levi Sanders. Credit: Charles Krupa | AP

CONCORD, N.H. — A toss-up congressional district featuring no fewer than 17 candidates, including Sen. Bernie Sanders’ son, topped the ballot Tuesday in a New Hampshire primary that provides one of the final measures of the country’s mood before November’s midterm election.

Accustomed to going first in the presidential primary, New Hampshire voters are among the last to nominate candidates for November, with Rhode Island and New York holding the nation’s last primaries later this week.

Democrat Carol Shea-Porter’s decision to step down after four nonconsecutive terms resulted in a swarm of candidates seeking to replace her in the intriguing 1st Congressional District, which roughly covers the eastern half of the state. The district was once reliably Republican but has flipped in each of the past four cycles. In 2016, it returned Shea-Porter to Congress but backed President Donald Trump.

Executive Councilor Chris Pappas and former Obama administration official Maura Sullivan lead a crowded field of 11 Democrats that also includes longshot Levi Sanders, son of the Vermont senator and former presidential hopeful. State Sen. Andy Sanborn and Eddie Edwards, former enforcement chief for the state liquor commission, emerged as the front-runners in the six-candidate Republican race.

Edwards, who received the backing of Trump attorney Rudy Giuliani, sought to make the race about character and integrity, and said he’d refuse to support Sanborn as the nominee. Sanborn, a four-term senator from Bedford, has acknowledged making a sexual “joke” to a Statehouse intern in 2013 but said a recent investigation into the matter was politically motivated.

On the Democratic side, Sullivan raised more money than the other 10 candidates combined, but she’s faced criticism for being both new to the state and voting in general.

She said she and her fiancé moved to New Hampshire last year to put down roots, but her opponents have accused her of district shopping. After the New Hampshire Union Leader newspaper reported that she failed to vote in either of the past two midterm elections or the 2016 presidential primary, Sullivan said she regrets not voting more often but saw herself as a soldier and public servant.

Pappas, who is openly gay, is a former state lawmaker who is serving his third term on the governor’s Executive Council and runs a family restaurant in Manchester. He gained the backing of the state’s two Democratic U.S. senators, and touted his strong financial support from New Hampshire residents.

Republican Gov. Chris Sununu faced no primary challenge as he seeks a second term, and will face either former state Sen. Molly Kelly or former Portsmouth Mayor Steve Marchand in November.

Seven Republicans are competing for a chance to face Democratic U.S. Rep. Annie Kuster in the 2nd Congressional District.

Secretary of State William Gardner is predicting 180,000 ballots will be cast, roughly split among Democrats and Republicans. That amounts to about 19 percent of registered voters and would be a record for Democratic ballots cast in a midterm primary.

Follow the Bangor Daily News on Facebook for the latest Maine news.