(YouTube/Tom for Virginia)

Former congressman of Virginia Tom Perriello made a late and startling entry into the race for governor Thursday, challenging Gov. Terry McAuliffe’s chosen successor in what had been a clear path to the Democratic nomination.

Perriello (D), who started spreading word of his candidacy the night before, made it official in the morning with the release of a slick campaign video that hit on populist themes and an appearance in a coffee shop in a region of the state hit hard by the loss of manufacturing jobs.

The name of the Danville shop jibed with the jolt Perriello was delivering to Democratic leaders who, for more than a year, had been confident that Lt. Gov. Ralph Northam (D) would have no primary opponent: Brewed Awakening.

“The American Dream started right here in Virginia, but our faith in it has been shaken,” Perriello says in the video. “Politicians from Washington to Richmond write their own, self-serving rules and seem committed to dividing and distracting us while they rig the system against the middle class.”

Until now, Northam had been the only Democrat seeking to succeed McAuliffe, who is barred by the state constitution from seeking back-to-back terms.

In a round of phone calls Wednesday, the one-term congressman told leading Democrats that he would jump into the race. Some of them were upset that Perriello would — just five months before the June 13 primary — threaten to disrupt what had been an unusually unified Democratic front.

While Republicans have been tearing one another apart in crowded primaries for governor and lieutenant governor, Democrats have been lined up behind Northam for more than a year — ever since Attorney General Mark R. Herring (D) decided in September 2015 to seek reelection instead of the governorship.

Some senior Democrats hoped to persuade Perriello, who has worked overseas for the State Department under President Obama, to stay out of the contest.

“He’s got a better chance of flapping his wings and flying to the moon than getting within 50 points of that nomination,” said state Senate Minority Leader Richard L. Saslaw (D-Fairfax), who had not heard directly from Perriello. “I’ve heard of some harebrained things, but this takes the cake.”

Perriello rode Obama’s coattails in 2008 to narrowly defeat a longtime GOP incumbent in a red-leaning central Virginia congressional district. He lost the seat two years later.

Northam, a widely liked but low-key former state senator, is a native of the Eastern Shore, a graduate of the Virginia Military Institute, a Gulf War veteran and pediatric neurologist. His campaign issued a statement saying that he still enjoys the support of the state’s leading Democrats.

“Ralph Northam is proud to have the support of Governor McAuliffe and Democrats across Virginia, including all of our statewide elected officials, and will continue to fight back against attempts by Republicans to discriminate against the LGBT community and limit women’s access to reproductive health care,” Brad Komar, Northam’s campaign manager, said in an email.

Brian Coy, a spokesman for McAuliffe, said Northam still has the governor’s backing. “He continues to believe that Lieutenant Governor Northam is the best candidate for governor,” Coy said.

Amy Dudley, a spokeswoman for Sen. Tim Kaine (D-Va.), confirmed that the senator still supports Northam.

But one Democratic elected official who supports Northam said Perriello’s entry into the race could be a positive development.

“I think competition usually is a good thing, as long as they don’t tear each other down and use up too many resources,” said the official, who spoke on the condition of anonymity to talk freely about the race.

“There are many voices within our party,” he said.