When all was said and done, 2018 was not the year of the winning progressive Democrat.

Moderate Democratic candidates were the big winners of swing congressional districts in the 2018 midterm elections, flipping most of the 28 key House districts from Republicans’ control and winning key gubernatorial races, including Michigan, Wisconsin, Kansas, and Illinois. Democrats’ net gain in the House was 26 seats.

Progressive candidates flipped few of those seats. For the most part, the biggest upsets for the left occurred during the summer primaries; most of those districts were already blue and primed to elect Democrats. Many of the left-wing candidates who tested the theory of turning out their base, even in more conservative districts, lost on election night.

But progressive energy still buoyed Democrats’ win in the House of Representatives. Even though Rep. Beto O’Rourke did not win the Senate race in Texas by running to the left, the race with Sen. Ted Cruz was still very close.

And enthusiasm for O’Rourke helped boost Democrats in key House races in the Lone Star State. Democrats Colin Allred and Lizzie Pannill Fletcher trounced longtime Republican incumbents, and Democrat Gina Ortiz Jones appears to still be locked in a tight race with Republican Rep. Will Hurd.

“There was a seven-point popular vote margin in the House for Democrats,” said Ezra Levin, co-founder of progressive grassroots group Indivisible. “Even in places where we didn’t get wins, there’s some pretty amazing infrastructure being developed on the ground.”

The major progressive wins happened in the primaries, but losses happened in November

There were two theories of how Democrats could win the midterms: by energizing their base or by turning out moderate voters in suburban and rural districts. On Tuesday, they did both, but their biggest wins came in suburban districts that had voted for Clinton in 2016 but had incumbent Republican House members. Democrats who attempted to win districts like that by appealing to the left’s base and running on issues like Medicare-for-all didn’t fare as well.

Progressive House candidates who lost on Tuesday included:

Kara Eastman in Nebraska’s Second Congressional District

Dana Balter in New York’s 24th Congressional District

Scott Wallace in Pennsylvania’s First Congressional District

Leslie Cockburn in Virginia’s Fifth Congressional District.

Even with these losses, election night wasn’t a total disaster for progressives; in the House, the Congressional Progressive Caucus will likely get high-profile new members. Some of the notable wins include:

Ayanna Pressley in Massachusetts’s Seventh Congressional District

Alexandria Ocasio-Cortez in New York’s 14th Congressional District

Deb Haaland in New Mexico’s First Congressional District

Rashida Tlaib in Michigan’s 13th Congressional District

Ilhan Omar in Minnesota’s Fifth Congressional District

A bright spot for progressives was Democrat Katie Hill defeating Republican Rep. Steve Knight in California’s 25th Congressional District (the race was close, but Knight conceded on Wednesday afternoon). Hill is in favor of Medicare-for-all, a key progressive litmus test. Katie Porter’s race in California’s 45th Congressional District is still too close to call; Porter is another progressive candidate touting Medicare-for-all running in a traditionally conservative district.

Statewide races were more difficult for progressives. In governor races, the candidates the left was most excited about — Stacey Abrams and Andrew Gillum — both trailed behind their Republican counterparts, but Georgia at least looked headed for a runoff.

There’s evidence that progressive candidates in big races like Texas’s senator and Florida’s governor spurred turnout among youth and minority voters, helping Democrats in down-ballot races. But ultimately, their big wins and the flipped districts they took were in the suburbs.

“There is a case to be made that a strategy when you have local candidates with the resources to tell their stories — that Democrats can win anywhere,” said Democratic Congressional Campaign Committee Executive Director Daniel Sena.

Even if progressive candidates didn’t all win, progressive energy buoyed Democrats

Even though there were some notable losses from progressive candidates, there’s no doubt there was increased energy and turnout among the Democratic Party in 2018.

As Vox’s Tara Golshan wrote, Democratic returns on election night were diminished in part because of the firewall Republicans built with partisan gerrymandering in many congressional districts, which made winning extremely difficult.

Democrats this year won the popular vote over the Republicans in House races by a 7.1 percent margin, but that didn’t translate to massive gains in actual seats. So far, Democrats have won 28 GOP-held seats for a net gain of 26 seats (they lost two seats previously held by Democrats in Minnesota and Pennsylvania). For years, Republicans, with their hands on the levers in state legislatures and governors’ mansions, have made it incredibly hard for Democrats to make gains in Congress, redrawing congressional boundaries to favor Republicans and passing laws that make it harder for Americans to vote. Democrats were able to overcome all that in 2018 — but they have a lot of work to do to replicate the success in the future.

Even though progressive candidates lost in the House, it doesn’t tell the full story of the 2018 election. Levin was quick to point out moderate, red-state Democrats in the Senate tried to appeal to Trump voters and still lost badly.

“When we run moderate candidates, we are not succeeding in peeling off the Trump voters,” he said. “It’s hard to look at the results in the Senate and say Beto [should have] run a campaign like [Indiana’s Joe] Donnelly, [Missouri’s Claire] McCaskill, and [Arizona’s Kyrsten] Sinema, because he did better than all of them, in a tougher state than them.”

Correction: An earlier version of this article stated Katie Porter had lost her race. As of Monday, the race was too close to call.