“Sometimes you can actually create as much change with a really transformative loss,” Tom Perriello told the New Republic after conceding Virginia’s Democratic gubernatorial primary to Lt. Governor Ralph Northam. It was the kind of sentiment that losing candidates have trotted out since time immemorial, a positive gloss to assure your supporters (and perhaps yourself) that all the glad-handing and money-soliciting and speech-making had not been in vain. But Perriello, despite putting on a brave face as he hugged staff and volunteers, seemed to mean it. The insurgent populist had just delivered a gracious, rousing call for unity at a rally at the State Theatre in Falls Church, and was proud of how his late campaign had changed the trajectory of the governor’s race. “No one’s ever run anything close to this progressive in Virginia,” he said. “When I got in this race, nobody was talking about a $15-an-hour minimum wage or two years of free community college. Now that’s mainstreamed in the party.”

If Perriello had reasons to be happy, then so does the Democratic Party. A race that had often been characterized as a redux of the Hillary Clinton-Bernie Sanders 2016 presidential primary, with all the bitterness and enmity that implies, not only ended amicably, but with a general election candidate who genuinely improved over the course of the campaign thanks to his opponent. Meanwhile, the Republican primary between Ed Gillespie, a former Republican National Committee chair with deep ties to the party’s establishment, and Corey Stewart, a neo-Confederate carpetbagger who was so extreme that he was fired by the Donald Trump campaign, ended with a squeaker of a victory for Gillespie, showcasing the GOP’s ongoing struggles with an extremist cancer that is eating at the party from the inside.

Most importantly, the energy is very clearly on Northam’s side. Northam received nearly as many votes as were cast in the entire Republican primary, suggesting that Democrats have close to a two-to-one advantage with energized voters heading into the general election. And Stewart and Gillespie won’t be holding hands anytime soon. After it became clear he would lose the election, Stewart was defiant. “There is one word you will never hear from me, and that’s ‘unity,’” he told supporters. “We’ve been backing down too long. We’ve been backing down too long in defense of our culture and our heritage and our country.”

Low turnout is not the GOP’s only problem. As the race tightened, Gillespie increasingly had to chain himself to Trump and appeal to Stewart’s supporters. Near the end of the campaign, he was running digital ads promising to fight for Virginia’s Confederate monuments. Gillespie will have to walk a fine line in the general election: In an increasingly blue state, he will have to embrace Trump to gin up support among his diehard supporters, while keeping Trump at arm’s length to appeal to, well, everyone else. And instead of facing an alleged Berniecrat (a description that has never quite fit for Perriello, whose closest ties are to the Barack Obama wing of the Democratic Party), he will run against a candidate, in Northam, with deep ties to the state, one who managed to win broad popular support while positioning himself as a fervent anti-Trumper.

For that, Northam can thank Perriello, who nationalized the race in ways that should send shudders down the spines of Republicans across the country. While the Virginia press was initially skeptical of Perriello’s constant hammering of Trump, Northam’s campaign eventually took up that mantle. His biggest moment of the campaign was when he referred to the president as a “narcissistic maniac.”

On policy, Northam followed Perriello on several issues. Once Perriello released his proposal for free community college, the Northam campaign issued its own (much smaller) proposal a week later. A day after Perriello announced his run, Northam appeared at a Fight for $15 rally.

Perriello nationalized the race in other respects. In addition to running on a broad platform centered on the minimum wage and college tuition, Perriello was able to bring a substantial level of national heat, including endorsements from Bernie Sanders, Elizabeth Warren, Clinton campaign chair John Podesta, and others. He was able to chip away at Northam’s financial advantage, particularly with the help of George Soros. Message-wise, he pitched himself as a through line between Barack Obama and Bernie Sanders, a model for the future of the party: a Democrat who could speak movingly about racial reconciliation while also connecting with blue-collar voters about automation, wages, and the degrading effect of corporate money on politics.

“Tom had a major impact on how this race was run,” said Prince William County School Board Chairman Ryan Sawyers, the first Virginia elected official to endorse Perriello. “He definitely changed the direction, changed the tone of Dr. Northam’s campaign by nationalizing this race, and I think that has great effectiveness for the party.” Caroline Wadhams, a Perriello volunteer who worked with him at the State Department and the Center for American Progress, saw a silver lining to the loss. “I think because Northam took on so much of what Tom stands for, I don’t actually feel like this discredits at all the message Tom was promoting.”

The Northam campaign, however, was able to undercut Perriello’s biggest strength: his progressivism. While Perriello’s economic message was in line with populist progressive policies, he was hamstrung by his record on reproductive rights and gun control. When he was a member of Congress, he voted for the Stupak amendment, which limited abortion access, and touted a high NRA rating. Northam, in comparison, has a strong record fighting for abortion access, leading the fight against a horrific vaginal ultrasound bill that made its way through Virginia’s legislature, and has been a staunch and steadfast advocate for gun control. There are blemishes on Northam’s progressive record, including his ties to Dominion Energy, the state’s energy monopoly. He also voted for George W. Bush, twice. But the fact that Perriello wasn’t able to run entirely to Northam’s left likely hurt him.

Furthermore, Northam undoubtedly benefited from a more traditional state-focused campaign. Northam had spent the last four years—years when Perriello was working for the State Department—building deep connections with Democrats across the state, particularly with African-Americans. The entire Virginia state party was behind him, and reports indicate that the Washington Post’s endorsement of Northam—which pitched him the way Northam pitches himself, as a Democrat who can work with Republicans and get things done—had a huge effect in the race.

For all the national attention that was thrust on the primary battle, Northam’s victory underscores the continued importance of retail politics and state parties. Northam had years of experience in the former and the entire support of the latter, and it paid off. While Perriello hustled across the state over the last six months, he wasn’t able to make up that ground. Northam won by over 11 points with key African-American districts and crucial Northern Virginia counties.

Northam’s victory will surely fuel debate about the future of the Democratic Party, and what role progressive candidates like Perriello play in it. “National Democrats should pay attention to what happened in Virginia tonight,” Jonathan Cowan, president of the centrist Democratic think tank Third Way, said in a statement. “A passionate moderate soundly beat a liberal populist who had ample resources and the most prominent populist endorsements in the country. The lesson is that liberal populism is not what Democratic voters are seeking in purple and red regions.”

But in fact, Northam won in part because he was willing to run to the left, especially once Perriello made it clear that the energy was on the progressive side. Northam is very much a member of the political establishment, but to argue that this was a victory for ideological centrism is not accurate. “When Tom jumped in, nobody expected this to be a competitive race,” said Adam Green, co-founder of Progressive Change Campaign Committee. “The reason it became so competitive in a few short months is that Democratic voters are increasingly hungry for a party that stands for bold, authentic, and inspiring ideas. Ralph Northam definitely sounded more progressive themes and became more vibrant in his criticism of Trump because Tom was such a competitive candidate.”

Perriello certainly still believes his message is the future of the party. “What I think is we were able to ground test a set of ideas about racial justice, about the challenges of monopolies and automation in the economy and of rising debt that I think are the next generation of conversations, and I think a politician more talented than me will come along and be able to learn from both things we did well and things we didn’t do well, and come back that much stronger,” he told the New Republic. “What we were able to prove is that you can actually build support across the progressive coalition while still appealing to white rural voters. That’s what we were starting to do, and someone better than me will come along and figure out how to take it to the next level.”