DOVER — Seven lawmakers running for reelection this year did not face a challenge in the primary and will not have an opponent on the ballot in next month’s general election, a stark contrast from 2016, which saw 23 candidates go unchallenged.

Four New Castle County Democrats and three Sussex County Republicans, all members of the House of Representatives, will not be sharing ballot space with anyone else, meaning they are essentially guaranteed reelection. That count includes Rep. Larry Mitchell, an Elsmere Democrat who does have a write-in foe, although Rep. Mitchell is virtually certain to coast to victory nonetheless.

Two more lawmakers have Libertarian opponents. Eight other seats, seven of which were open, had only primary contests, although one of those eight primary winners will face a write-in opponent Nov. 6.

Fifty-one legislative offices — 10 in the Senate and all 41 House posts — are on the ballot this year.

Democrats have candidates running for 47 legislative offices while Republican candidates are in 38 such races. Every seat Democrats are not contesting is in Sussex, while every office unopposed by the Republican Party is in New Castle.

The relatively small number of uncontested seats — 2014, the last midterm election, saw 14 legislators go unchallenged — can likely be traced back to a spate of retirements. Eleven legislators announced before the June 30 close of the regular legislative session they would not seek reelection. Additionally, two representatives said they would run for the Senate, effectively leaving a quarter of the seats on the ballot this year open.

Those retirements caused candidates to jump into the fray, and as a result, Sept. 6 featured 17 legislative primaries, including seven with at least three candidates.

While July 10 was the last day candidates could file for office, the two major parties had until Sept. 4 to place Delawareans on the ballot for seats in which the parties did not have anyone running.

As of July 11, there were 13 uncontested seats. The Democratic Party has since gained four candidates, while the GOP has picked up two.

Officials from both parties say they have worked to attract quality candidates in as many districts as possible.

“We’re going to be competitive in places people don’t expect us to be,” Delaware Democratic Party Executive Director Jesse Chadderdon said last week.

Delaware Republican Party Chairman Mike Harrington Sr. said in July the party was pleased it is contesting every seat in Kent and Sussex counties but was not optimistic about recruiting Republicans to run for New Castle districts.

“If there’s 10,000 voters, there’s 8,000 Democrats. I am working on it, but I’m not too hopeful that I’ll find somebody,” he said.

Of the 15 seats that feature only one ballot-qualified candidate for the general election, 11 have a Democratic candidate. Ten of those 11 districts are majority Democratic in terms of voter registration, while the remaining one has a plurality.

None of the districts are 80 percent Democratic, but a few come close.

The four seats sought solely by Republicans are among the 12 districts that have more registered Republicans than Democrats, although the GOP does not hold a majority in any district.

Among incumbents seeking reelection next month, no one has gone longer without an opponent than Rep. Mitchell, who last had someone run against him in 2010.

Four returning lawmakers who have faced reelection have had only one opponent. Senate Majority Whip Nicole Poore, a New Castle Democrat; Sen. Brian Pettyjohn, a Georgetown Republican; and Rep. Tim Dukes, a Republican from Laurel, were all elected in 2012, which remains the only year they have had a challenger.

Rep. David Bentz, a Christiana Democrat, defeated a Republican in a 2015 special election, was uncontested in 2016 and will not have a foe next month.

Rep. Melanie George, a Democrat from the Bear area who is retiring, was first elected in 2002. She won a primary that year for the newly redrawn district and has never faced another opponent — but that still isn’t the longest streak in terms of years: Senate President Pro Tempore David McBride, a Democrat from New Castle, last had a challenger in 1986.

Sens. McBride, Poore and Pettyjohn are not on the ballot this year.

Jennifer Hill, program director for the good government group Common Cause Delaware, applauded the high rate of participation compared to prior elections.

“I think most people would agree with me that Delaware has in past years not always been the most competitive place to run,” she said.

Ms. Hill noted energy sparked by national issues has likely encouraged some people who otherwise would not have entered the political arena to run.