In each congressional special election this year, Democrats have fallen short every time. But local races are telling a different story.

The latest example came Tuesday night in New Hampshire, where Democrats won a state Senate seat in a historically Republican stronghold.

The winning candidate, Democrat Kevin Cavanaugh, was replacing another Democrat, the first to win in the district in 50 years. Because the seat didn’t change hands, the win might not seem like much of a feat, but Democrats see Cavanaugh’s win as a good sign for two reasons: He’s a political newcomer who beat a well-known Republican candidate who had previously held the seat for six years, and he ran 11 points ahead of Hillary Clinton’s totals in the district last November.

That earned Cavanaugh a shoutout from Tom Perez, chair of the Democratic National Committee.

It's been 33 yrs since a Democrat won a NH state senate special election. You just showed what organizing can do, @CavanaughForNH. Congrats. https://t.co/1lnAX95djl — Tom Perez (@TomPerez) July 26, 2017

New Hampshire isn’t the only place where Democrats are notching local wins. A few weeks ago, Democrats managed to flip two seats in the Oklahoma state legislature in districts Trump won in 2016.

About 8,700 people came out to vote on Tuesday (nearly 21 percent turnout), which is more than a midsummer special election usually draws.

Most of these races are low-profile, and their immediate effects are minor. Republicans still control state legislatures in 32 states. But the victories in small races are starting to add up: In 21 of the 28 special elections held since November (including congressional races), Democratic candidates have outperformed Hillary Clinton’s 2016 election margins by an average of 12 points. They have won 13 races and flipped four.

It’s still too early to tell if Democrats can carry this momentum into the 2018 midterms, but so far, the signs are encouraging.

“This is after Democrats routinely underperformed Barack Obama’s margins in special elections leading up to the 2014 midterm,” said Kyle Kondik, managing editor of Sabato's Crystal Ball at the University of Virginia Center for Politics. “So it may be a sign of increased Democratic enthusiasm with Trump as president and also a reflection of the usual midterm pattern, which is that the public often prefers partisan balance against the White House party rather than reinforcing the White House party.”

Why Democrats’ New Hampshire win could matter

At first glance, Democrats winning District 16 may seem easy; the special election was to replace Democratic state Sen. Scott McGilvray, who died just a few months into his term. McGilvray flipped the seat in November, the first Democrat to win District 16 in nearly 50 years — and did so by just 2 points. Cavanaugh won Tuesday night by a much wider margin of 11 points.

District 16 is split among three wards of New Hampshire’s largest city of Manchester and four more small towns surrounding it. The area is home to wealthier, well-educated voters who used to vote reliably Republican but are leaning more Democratic these days, according to University of New Hampshire political science professor Dante Scala.

The New Hampshire election showed a Democratic newcomer going up against a seasoned Republican politician who “was about as close to an incumbent as one can get in a special election,” said Kondik.

New Hampshire Democratic Party Chair Ray Buckley said the party’s outreach to voters was strong. But he also believes national politics is helping motivate the party’s base.

“Our models, we blew through them on how many people we expected to show up,” Buckley said. “They really have inspired Democratic turnout. It’s a huge sign for us.”

In the most recent special election, the Republican and Democratic parties both raised tens of thousands for their respective candidates, but ultimately, momentum was on the Democrats’ side.

“It wouldn’t surprise me right now that the Democratic base is more energized,” said Scala. “What to make of yesterday — is it a demoralized Republican base? Arguably, it’s more of a sleepy Republican base.”

In November, voters in New Hampshire went for Clinton and sent four Democrats to Congress, while also electing the first Republican governor in more than a decade and giving the GOP majorities in the state legislature.

In three out of four special elections this year, though, the news for Democrats has been good. In May, New Hampshire Democrats also managed to flip a state representative seat in the tiny lakeside town of Wolfeboro, which hadn’t elected a Democrat since 1913.

Heading into 2018, Democrats are challenging a number of incumbents in areas that went big for Trump in 2016. The question now is whether the results in places like New Hampshire are indicative.

Right now, national polls are showing Democrats with a double-digit lead on the generic ballot, a term pollsters use to ask voters which party they’d like to see win the House of Representatives. Before they swept the House in 2006 and 2008, Democrats had a 9-point lead on Republicans.

A lot could happen between now and 2018, but the president’s party usually suffers big losses in the midterms; they’ve lost 33 seats on average in the majority of midterms since the Civil War, according to Kondik.

Trump is still unpopular, and Republicans in Congress are still floundering on their political agenda. It may help boost the other side. In New Hampshire, Buckley said he thinks the coincidence of the special election being held the same day as the Senate vote on health care helped boost Democratic turnout.

“There’s this feeling out there of wanting to send a message,” he said.