Democratic U.S. Senate candidate Doug Jones from Alabama acknowledges supporters at the election-night party in Birmingham, Alabama, on December 12, 2017. Marvin Gentry / Reuters

After losing the White House in 2016, the Democratic Party finally has a string of victories to celebrate. In November, Democrats won high-profile races in Virginia, New Jersey, and other states. And on Tuesday, Democrat Doug Jones defeated Republican Roy Moore in a stunning upset in Alabama in the U.S. Senate special election.

But the unique circumstances of the Alabama race, where Moore faced allegations of sexual misconduct with teenage girls, aren’t likely to be replicated. The party also hasn’t yet proved that it can win national races in states that flipped from blue to red during the 2016 presidential election.

Party officials are still cheering the wins as a sign of good things to come. Tom Perez, the Democratic National Committee chairman, predicted on Wednesday that the party can win the House and the Senate in 2018. “Last night was not a fluke, it was a message: The days of Donald Trump are numbered,” Perez said.

Democrats have real advantages heading into 2018. The president’s party typically loses seats in midterm elections, and Trump is a historically unpopular president. Democrats have also consistently outperformed expectations in special elections, a sign that voters are energized. And progressive groups and the DNC have, to some extent, found common cause in a strategy that emphasizes grassroots organizing.

“Republican candidates in 2018 might not be as flawed as Roy Moore, but the battleground districts and states won’t be as Republican as Alabama,” says the Democratic strategist Jesse Ferguson. “This race had started to close before the allegations came out because of backlash against President Trump … and one of the keys that put us over the top was a coalition of organizing that included the DNC and others.”

The DNC, for its part, is emphasizing a commitment to the grassroots. “The new DNC is all about talking to people in every zip code, building relationships in every zip code,” Perez told reporters on Wednesday. As the party seeks to repair its battered image, Perez is also trying to prove that it has learned from its mistakes. “In the past, the Democratic Party all too frequently took voters for granted,” Perez said, adding that those days “are in the rearview mirror” and that “the new Democratic Party is organizing everywhere.”

One of the most pressing challenges for the DNC is to win back the trust lost in the last election when hacked emails showed then–Chairwoman Debbie Wasserman Schultz disparaging Bernie Sanders, a Democratic primary candidate. As new progressive organizations have cropped up to channel the frustration and anxiety of Democratic voters in the aftermath of the presidential election, the DNC faces pressure to prove that it can also be an effective conduit for pent-up grassroots energy.

The DNC invested close to $1 million in the Senate race in Alabama, all of which helped fund voter-contact and organizing efforts to drive up black and Millennial voter turnout. A surge in black-voter turnout helped propel Jones to victory on Tuesday evening.  

A broad array of liberal organizations were also working to get out the vote for Jones in the race, including progressive groups such as MoveOn, Democracy for America, and the Working Families Party. MoveOn volunteers sent thousands of text messages encouraging people to vote, while Working Families Party volunteers helped recruit people to phone bank and knock on doors in Alabama.

“I think the real story is that the DNC and traditional institutions in the Democratic Party are not the only game in town. There are a lot of outside groups doing really important work to tap into grassroots energy and activism,” says Joe Dinkin of the Working Families Party.

National Democrats kept a low profile in the race. The DNC did not publicly announce the extent of its investment in the race until the day of the election in Alabama as part of a strategy to keep the focus on Jones and his campaign. “We operated below the radar screen because that was in the best interest of the race. But make no mistake about it, we were below the radar screen, but we were present,” Perez said on Wednesday.

That could be viewed as further evidence that the Democratic Party’s brand is damaged. A poll released in April found that a majority of the public thinks the Democratic Party is out of touch with the concerns of average Americans, a data point that alarmed some Democrats in Congress and highlights the image problem the party has grappled with in the wake of Trump’s election, even as the president himself remains historically unpopular.

But in the Alabama special election, the strategy appears to have paid off. It’s possible that the under-the-radar approach could provide the party with a template that might prove successful in red and purple states in 2018.

“The darkest times for Democrats are when everyone is jockeying for credit and donor attention rather than just doing the work,” says Ben Wikler of MoveOn. “In Alabama, people were focused on victory.” Wikler says he was “delighted that the DNC hired 30 organizers to support field efforts in Alabama.” “That’s exactly the kind of investment in ground game we need to maximize the 2018 wave,” he says.

The Democratic Party is still far from united. Ideological differences between the ascendent progressive wing of the party and centrist Democrats remain. Jones ran as a liberal Democrat on a pro-choice and pro-immigrant-rights platform. He did not, however, endorse the kind of progressive agenda championed by Sanders. Our Revolution, the progressive group that spun off from the Sanders presidential primary campaign, did not endorse Jones, though it did congratulate him on his win on Tuesday evening. Sanders congratulated Jones as well.

Jones himself also ran a campaign that was clearly intended to reach out to both core Democratic voters and persuadable Republicans at the same time. In the closing days of the race, the campaign cut ads that featured a warning from Republican Senator Richard Shelby of Alabama who had said he would not vote for Moore and that the Republican Party “could do better.”

For all the talk of division within the Democratic Party after Hillary Clinton’s defeat, however, Republican Party divisions were far more prominently on display after Moore lost his race on Tuesday. An adviser to the Breitbart News chairman Steve Bannon lamented, “Mitch McConnell and his establishment allies got the Democrat that they wanted in Alabama,” while a McConnell-aligned super PAC released a statement accusing Bannon of having “cost us a critical Senate seat in one of the most Republican states in the country.”

A lot could change in the run-up to the 2018 midterm elections, and it won’t be easy for Democrats to win back both the House and the Senate. The Alabama election showed, however, that once-unthinkable upsets are not just possible for Republicans; they can happen to Democrats too. And the Democratic party isn’t so divided, or hobbled by its past defeats, that it can’t still win.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.