Virginia Lt. Gov. Ralph Northam waits for the chamber to fill before the start of the Senate session at the state capitol in Richmond. (Timothy C. Wright/For The Washington Post)

Democrats’ plans for a well-ordered march to the Virginia governor’s election this fall are being redrawn on the fly.

The unexpected decision of former congressman Tom Perriello to challenge Lt. Gov. Ralph Northam for the Democratic nomination upended more than a year’s worth of preparation to take on the Republicans. The primary battle disrupts the plan to roll out a statewide coordinated campaign for candidates up and down the ticket, causing grumbling around the state Capitol and raising fear that Democrats are losing an advantage in a race of unusual political significance.

The party is well aware the whole country is watching Virginia after the dramatic presidential election. As the only state with both a governor’s race and the whole House of Delegates running this fall, Democrats nationwide view it as a crucial offensive against President Trump. As Jesse Ferguson, a former aide to Democratic nominee Hillary Clinton, put it in the Richmond Times-Dispatch, “The resistance starts in Richmond.”

In the original vision, Northam’s big war chest — about $2.5 million on hand, the most of any candidate — would have provided a huge head start on a crowded Republican field. National donors would already be lining up for a statewide push.

Instead, Northam’s funds will have to pay for the fight against Perriello — a promising, attractive politician who many in the party like. National donors will probably stay on the sidelines until a single candidate emerges in the June primary, and the candidates will focus on areas of biggest Democratic turnout, such as Northern Virginia.

Virginia Lt. Gov. Ralph Northam is seen at his capitol office as he works at his desk. (Timothy C. Wright/For the Washington Post)

[A surprise candidate shakes up Virginia’s governor’s race]

“For a whole lot of people I know, it’s kind of an uncomfortable situation,” said state Sen. R. Creigh Deeds (D-Bath), who was the party’s nominee for governor in 2009 and who represents some of Perriello’s relatives outside Charlottesville. “People are already committed to Ralph, but they like Tom. I like Tom. . . . But I’m not wavering in my support of Ralph.”

With Republicans firmly in control of the state legislature, the pressure is high for Democrats to hang onto the executive mansion. Gov. Terry McAuliffe (D) delivered Virginia as the only Southern state to go for Clinton but is prohibited by the state constitution from serving a second consecutive term.

Republicans have a four-way race on their hands for the nomination but went into the year planning for a wide-open contest. Democrats woke up to the Perriello news on Jan. 5, and Northam’s campaign — which is backed by McAuliffe and the vast majority of other elected Democrats — has been regrouping ever since.

“To me, the worst thing you could do is overreact,” said state Sen. J. Chapman “Chap” Petersen (D-Fairfax), a longtime Northam ally. “You need to have your own plan and stick to it.”

Northam, 57, was elected lieutenant governor in 2013 after serving in the state Senate since 2008, representing the Eastern Shore. He checks off a lot of boxes for a Democratic candidate — he’s a retired Army major who favors gun control and a pediatric neurologist who gets high ratings from women’s health advocates.

Still, Northam surprised many Senate colleagues when he ran for higher office — his muted, country-doctor demeanor does not always translate well to large groups. But he built strong loyalty in the state Capitol and with McAuliffe, and his status as lieutenant governor positioned him as the Democrats’ standard-bearer for this year’s gubernatorial race.

Virginia Lt. Gov. Ralph Northam uses the Senate gavel to start the Senate session at the state capitol in Richmond. (Timothy C. Wright/For The Washington Post)

The party had hoped to present a united front — no Democrat has won the governor’s seat in recent years after going through a primary battle, as opposed to being nominated in a convention and saving resources for the general election.

“We’ve had to make a couple modifications” to the campaign, Northam acknowledged in an interview. Before, he said, “we were focused on the general election in November.”

But he played down the consequences of having to gear up for a primary fight. It will not change his message, he said, and it will draw more attention to the party earlier in the year.

Other Democrats expressed anger at Perriello. A former one-term congressman from Charlottesville, Perriello, 42, became close with former president Barack Obama and served several diplomatic roles for that administration. He is a formidable opponent for Northam, energetic and capable of tapping populist zeal — but his timing stung.

“We could be in a different situation if we had just had some advance notice that we were going to be in the middle of a primary,” said one Democratic official, who spoke on the condition of anonymity to discuss internal party affairs. Northam’s organizers “have had to totally reevaluate their campaign plan generally,” the official said.

That hitch is “to the detriment of every other Democrat who is on the ballot this year” because it delays the broader coordinated campaign, the official said.

Northam has heard some of the grumbling about the delay in the coordinated campaign, but said the legwork he has done over the past few years should stand him in good stead with the rest of the Democratic ticket.

“I counted up. I’ve done over 180 appearances over the last year for delegates, for senators, for local folks that are running in elections,” he said. “So we’ve been doing a lot of grass-roots work, traveling around. I’ve put over 100,000 miles on our Prius in the last two years. So we’ve helped a lot of people. I’ve got unwavering support from folks across the commonwealth.”

Perriello makes no apologies for entering the race. He has said the timing was determined by when he stepped down from his diplomatic job in late December, because the Hatch Act prohibits federal employees from participating in politics.

Whether Democrats were right to hope for an orderly coronation of Northam remains to be seen, he said in a recent interview. “Everyone’s going to have to make their own decision on that,” Perriello said. “The things that I hear from Democratic voters across the state is, one, most of them didn’t know that a governor’s race had even started; and two, that they feel like it should be the voters in the party who decide who the nominee should be.”

[Perriello renounces NRA support, calls group nut-job extremists]

Now that the shock of his announcement has subsided, some Democrats say the primary could be a good thing. U.S. Rep. Gerald E. Connolly, one of the few elected Democrats who has yet to endorse a candidate, said competition is always better.

“The Democratic political establishment in Virginia had decided two years ago that this was done, put a fork in it, we’ve decided there will be no contest, and we can all start planning for the general election in November,” he said. “This will be a real test of that establishment and of Ralph’s campaign itself. Can you quickly repivot to this challenge and use it as an opportunity to really put yourself on fighting terms in November? Or are we going to see machinery that’s kind of rusty and lying in a dusty field somewhere because you weren’t anticipating any challenge?”

The primary race will at least give the candidates a chance to introduce themselves to voters, who hardly know them at all. Recent polls have indicated that the overwhelming majority of Virginia voters have no opinion about any of the candidates in the race.

And while national donors may wait out the nominating contest, few doubt that they will show up en masse once there is a nominee.

Virginia “was going to be a top investment, and it will continue to be a top investment,” said Jared Leopold, spokesman for the Democratic Governors Association, which funds races nationwide.

[Republican group makes record $5 million bet on Virginia governor’s race]

The other advantage of a primary is that it will generate lots of data about voters. Virginia holds open primaries, meaning voters do not have to be a party member to cast their ballot. If only one party holds a primary, anyone can help select the nominee.

But voting in two primaries is prohibited, so Republicans and Democrats alike will see where their most committed voters are in the June races. That will help the nominees know where to concentrate their efforts in November.

Northam supporters say he has an edge over Perriello for the nomination because of his lengthy preparations.

“Ralph has lined up the community leaders. At the end of the day in a primary, having key people with deep roots in the community who are willing to mobilize their networks to support you will matter,” said state Sen. Barbara A. Favola (D-Arlington), another Northam ally from his time as a senator.

And if Perriello is counting on whipping up a Bernie Sanders-like outsider campaign, the timing of the June primary could be a liability. A lot of Sanders’s support came from college students, and “those folks are not going to be on campus in June,” Petersen said.

At some point, Petersen said, Perriello and Northam will have to go negative against one another. That is a little hard to envision — Perriello calls Northam a “great lieutenant governor,” and Northam has not shown a nasty streak. In fact, Northam said he and Perriello have promised each other to keep things positive.

The first order of business, though, is simply getting out in front of voters. There, Northam has a potential handicap compared with Perriello, who has been barnstorming around vote-rich Northern Virginia.

As lieutenant governor, Northam must preside over the state Senate every day. And until the General Assembly wraps up its session on Feb. 25, he is barred by state law from fundraising.

Northam says he does not worry about being stuck in Richmond while Perriello travels the state. “I don’t look at that as a disadvantage,” he said.

Clark Mercer, Northam’s chief of staff, said the first straw poll of the campaign was two weeks ago in Fairfax County, and Northam won handily. “The lieutenant governor won, I think, 130 to 20,” Mercer said. “Every supervisor in Fairfax that has a D next to their name, the lieutenant governor’s done an event for.”

“The exact number,” Northam interrupted, “was 121 to 20.”

Northam has made some weekend trips, such as participating in the Women’s March on Washington on Jan. 21.

And in some ways, the state comes to him.

His staff said he attends more than a dozen events a day during the legislative session, appearing at Richmond rallies for gun control, women’s health and in support of the Affordable Care Act — each time addressing crowds from all over Virginia. And every day, the Senate opens with greetings to visitors in the gallery from various members’ districts, giving Northam a chance to deliver personal messages.

One recent day he was able to greet 4-H clubs from far corners of rural Virginia (“I’ve been through there many times and always enjoy visiting,” he said about Wythe County), leaders of the Precast Concrete Association and a group from the Virginia Society of CPAs (“We need to have a competitive tax code with other states in order to attract business to Virginia,” he told them).

At that moment, though, Perriello was campaigning at a health-care center in Falls Church, after he had already taken doughnuts to a fire station in Fairfax County and then visited a brewery, part of a grueling schedule of hitting all nine of the county’s magisterial districts in one day.

Perriello also was in the crowd — and on TV — last weekend at Dulles International Airport with demonstrators angered by Trump’s executive order restricting Muslim travelers. Northam, committed to events in the Richmond area, responded from afar — tweeting out a sober video of himself alone at a podium, reading a statement of protest that was retweeted 35 times.

Fenit Nirappil contributed to this report.