Tom Perriello, a former congressman and a candidate for the Democratic Party’s gubernatorial nomination, gives his concession speech at the State Theatre on June 13, 2017, in Falls Church, Va. (Molly Riley/AP)

The defeat of Tom Perriello, who ran as a populist with the backing of Sen. Bernie Sanders in Tuesday’s gubernatorial primary in Virginia, marked a loss for the progressive wing of the Democratic Party.

But the results had more to do with timing and the strength of the state’s party apparatus than with ideology, analysts say.

Lt. Gov. Ralph Northam, who beat Perriello for the Democratic nomination by 12 percentage points, had the backing of nearly every Virginia Democrat elected to state and federal office — the result of years of cultivating relationships. And he outspent Perriello by $1.4 million on advertising, affording himself a heavy television presence — especially in the costly metropolitan Washington market — in the last weeks before the election.

Perriello, a former one-term congressman, jumped into the race in January hoping to overcome Northam’s structural advantage by riding a wave of anti-Trump and national progressive energy, bolstered by endorsements from Sanders (I-Vt.) and Sen. Elizabeth Warren (D-Mass.).

But it was too little, too late.

“The lesson here was you cannot get in a race very late and underfunded against a candidate who has been raising money and organizing for a long time and who has every meaningful endorsement from the Democratic Party,” said Jennifer Duffy, who monitors gubernatorial contests for the nonpartisan Cook Political Report. “I don’t think this has anything to do with progressivism.”

Perriello was unable to raise millions of dollars in small donations, even with the help of national progressive groups that sent fundraising pitches to millions of potential donors. He relied on a few wealthy donors to write six-figure checks and lent himself $150,000 in the campaign’s final days.

Meanwhile, Northam was airing ads touting his endorsements from unions, abortion rights groups and other progressive organizations, showcasing his background as a doctor and an Army veteran and calling President Trump a “narcissistic maniac.”

Perriello’s internal polling showed him plunging 12 points in the final week of the campaign, mostly in vote-rich Northern Virginia, after Northam won the endorsement of The Washington Post editorial board and outspent Perriello on advertising by 2 to 1, according to Ian Sams, Perriello’s spokesman.

“In what became a high-turnout, low-information election, the spending disparity made a real difference in giving voters just enough information about Ralph to help him win,” Sams said. “It was a competitive advantage we couldn’t overcome.”

Democratic primary voters also seemed disinclined to rebel against the state party establishment. Outgoing Gov. Terry McAuliffe and U.S. Sens. Tim Kaine and Mark R. Warner are beloved by Virginia Democrats. And all three backed Northam.

“The real story, at least on the Democratic side . . . is people are generally happy with their leadership,” said David Turner, Northam’s spokesman.

Perriello’s campaign found it an enormous challenge. “It’s hard to break through against an entire unified state Democratic Party operation, and we knew that from the beginning,” Sams said.

In the primary, Perriello did exceptionally well with rural voters, sweeping the southern and western parts of the state, while Northam claimed the more populated “urban crescent” of Northern Virginia, Richmond and Hampton Roads. He also did well among African Americans — a key Democratic constituency.

Throughout his campaign, Perriello argued that Virginia Democrats need to retool their approach to attract greater numbers of rural, young and minority voters after squeaker races for governor in 2013 and the U.S. Senate in 2014.

But that message was undercut by the party’s winning streak. Democrats hold all five statewide offices and won the state in the past three presidential contests — Virginia was the only Southern state to back Hillary Clinton in the election in November.

Perriello’s embrace of the progressive agenda — increased taxes on the wealthy to fund free community college, universal prekindergarten and paid family leave — made him a darling of the movement, as well as a favorite among some mainstream national Democrats. He slammed the corporate influence in politics and refused to accept donations from Dominion Energy, the state’s largest political donor and a contributor to Northam.

Northam embraced programs he thinks can win support from Republicans, such as state funding for technical apprenticeship programs. A pediatric neurologist who championed reproductive rights and gun control, Northam could not be easily cast as an establishment villain.

Because Northam and Perriello held similar views on policy, voters were left with a nuanced choice between styles: pragmatic or aspirational.

“They were both what I would call mainstream progressives. One may have been more progressive on economic issues, [and] one may have been progressive on guns and choice,” said Jesse Ferguson, a Democratic operative with roots in Virginia.

Perriello’s defeat seemed to call into question the power of the Democratic Party’s progressive wing, which has been trying to push candidates leftward as the party navigates the Trump era.

Progressive have lost other high-profile races this year, including special congressional elections in Kansas and Montana and contests to chair the Democratic National Committee and California Democratic Party.

“Their bark may be worse than their bite,” said Geoffrey Skelley, an analyst at the University of Virginia Center for Politics. “They have a lot more work to do if they want the reality of their influence to match what they think their influence is.”

Progressive activists say they left a mark, although Northam won.

“There would have been an unquestioned victory for progressives had [Perriello] won,” said Adam Green, co-founder of the Progressive Change Campaign Committee, which is aligned with Warren and backed Perriello. “But big-picture, unlike several years ago, it’s now very hard to find a Democratic primary where there is not competition to claim the mantle of progressivism and one-up each other on strong positions like $15 minimum wage. And that’s what we saw in Virginia.”

Perriello supporters seem to be coalescing around Northam, although some environmentalists are withholding support, demanding that he denounce two gas pipeline projects, as Perriello did.

As he goes into the general election campaign against Republican Ed Gillespie, Northam is Virginia’s first Democratic gubernatorial nominee to support measures including the $15 minimum wage, some form of free higher education and driver’s licenses for immigrants living in Virginia illegally.

The GOP is already attacking Northam as extreme. A $5 million PAC funded by the Republican Governors Association started spending on digital ads the day after the primary, setting up a website called tooliberalralph.com.

Northam’s spokesman disputed that Perriello had nudged the lieutenant governor to the left.

“He has always advocated for an increase in the minimum wage, and he’s always advocated for working families,” Turner said. “What voters wanted . . . is someone who had a proven record of getting stuff done in Richmond.”