Republican gubernatorial candidate Ed Gillespie, left, and his Democratic rival, Lt. Gov. Ralph Northam. (Bill O'Leary/The Washington Post)

Republican Ed Gillespie and Democrat Ralph Northam staked out sharply different positions on immigration, health care, Virginia’s economy and President Trump on Saturday in their first debate since winning their respective party primaries for governor on June 13.

Their differences started with Trump. Northam, Virginia’s lieutenant governor and a pediatrician, said he had no regrets about a TV ad in which he called the president a “narcissistic maniac.”

“I stand by what I said,” he said. “I believe our president is a dangerous man. I think he lacks empathy. . . . And he also has difficulty telling the truth.”

Gillespie, a former Republican National Committee chairman, lobbyist and counselor to President George W. Bush, is an establishment figure who has largely tried to keep Trump at arm’s length. But in recent days, he has touted his ability to work with the president and on Saturday questioned whether Northam could do the same.

“What are you going to do — call the White House, ‘Please put me through to the narcissistic maniac’?” Gillespie said.

Gillespie and Northam are vying to succeed Gov. Terry McAuliffe (D), who is prohibited by the state constitution from serving consecutive terms.

Libertarian Cliff Hyra will also be on the ballot in November but was not invited to the debate at the Omni Homestead Resort.

There were no obvious missteps during the debate, though it opened with unscripted drama. A man protesting the construction of two proposed natural gas pipelines rushed to the front of the room and yelled “No pipelines!” and interrupted Northam’s opening statement until he was escorted out of the room.

Gillespie supports construction. Northam said he will support it only if regulators say the pipelines can be built safely without harming the environment and that the decision ultimately is a federal one.

As one of just two states with a gubernatorial contest this year (the other, in New Jersey, is not considered competitive), the Virginia contest is widely seen as an early referendum on Trump. Both national parties are invested in the outcome and will lavish resources and attention on the race.

But emphasis on national politics in this first debate led to some criticism from Republicans. State GOP Chairman John Whitbeck complained that moderator Judy Woodruff of “PBS NewsHour” kicked off the 90-minute event with what he considered “anti-Donald Trump” questions.

She opened by asking Northam if he thought the president was unfit for office. She then noted Gillespie’s reluctance to talk about Trump and invited him to weigh in on several topics, including the firing of FBI Director James B. Comey and reports that the president was exploring whether he can pardon himself — although Gillespie declined to say.

Woodruff also asked Gillespie whether he would support the president if he were to fire Robert S. Mueller III, the special counsel probing Russian meddling in the 2016 presidential election.

“Judy, I understand and I appreciate and I respect and I’ve seen your show, and I know that it’s very focused on what’s going on Washington, D.C., but the fact is, I’m very focused on what’s going on in Virginia,” he said. “I think the people who are here, Virginians, want to know what are we doing in our state government to make things better for all Virginians.”

That line drew applause, and Gillespie’s campaign quickly circulated a video clip of what it called the “key moment” of the day — “Ed Gillespie: Let’s Focus on Virginia.”

But Northam argued that Trump’s policies have an effect on Virginians, particularly immigrants who fear deportation and those concerned about losing health care provided by the Affordable Care Act.

“You’ve really been missing in action on all these issues,” Northam said to Gillespie.

Whitbeck called Woodruff an “extremely biased moderator.” Northam’s campaign scoffed at that suggestion.

“If you’re complaining, you’re losing,” Northam spokesman David Turner said.

Asked about Whitbeck’s criticism, Woodruff said she posed the Trump questions at the suggestion of several members of the Virginia Bar Association, which hosted the debate.

“It’s the elephant in the room,” she said. “Let’s talk about it and move past it. It comes up in every conversation I’ve had with voters.”

During the debate, the candidates offered starkly different views of the state’s economy. Gillespie noted that Virginia had slipped in business rankings and said the low unemployment rate — 3.7 percent — masked that fact that many Virginians were working part time or at low-paying jobs.

Northam touted robust job creation under McAuliffe and noted that Gillespie, when he was a senior adviser to former Massachusetts governor Mitt Romney’s 2012 presidential bid, celebrated that state’s 4.7 percent unemployment rate.

On health care, Northam conceded that there was “a lot to improve upon” in federal law. But he also called it “just immoral” that so many Virginians go without medical care. He supports expanding Medicaid under Obamacare to provide insurance to 400,000 Virginians. He headed from the debate to far Southwest Virginia to volunteer at a free health clinic at a county fairgrounds where people camp out every year for the chance to see a doctor or dentist.

Gillespie said a better solution is to enact policies — his proposed 10 percent income tax cut among them — to stimulate the economy and provide people with the “dignity of work” and employer-based insurance. He said states that had expanded Medicaid were finding that its costs were crowding out other priorities such as education.

“Ralph’s answer for everything is to have the federal government do something,” Gillespie said.

The candidates disagreed on offshore drilling and fracking. Northam is opposed to both, Gillespie in favor. Northam, who has an F rating from the National Rifle Association, called for universal background checks and reinstating the state’s one-per-month limit on gun purchases. Gillespie, who has an A from the NRA, said studies have shown that crime goes down when more people carry concealed weapons. He also said that he would roll back McAuliffe’s executive order banning guns from certain state buildings.

Northam spoke in favor of allowing immigrants illegally brought to the United States as children — known as “dreamers” — to receive in-state tuition at Virginia colleges. Gillespie said scarce university slots should go to legal Virginia residents.

Despite their differences, the tone was respectful. Northam sometimes cast criticisms in the folksy idioms of his native Eastern Shore. “As we say on the Eastern Shore, he lies like a rug,” Northam said of Trump.

Gillespie and Northam emerged from their primary contests on vastly different footing — Northam with a greatly depleted war chest but energized Democrats seemingly united behind him, Gillespie with nearly twice as much cash but a bitterly divided party on his hands.

Northam fought off an aggressive challenge from former congressman Tom Perriello. While polls and pundits predicted a nail-biter, Northam beat Perriello by 12 points.

That stronger-than-expected finish and Perriello’s wholehearted endorsement of Northam after the primary seemed to allay fears of a divided Democratic Party, despite continued protest from some pipeline foes.

The primary pushed Northam, whose moderate image as a state senator once had the GOP courting him to switch parties, to the left — something that could complicate his efforts to pick up swing voters. He embraced a $15-an-hour minimum wage and supported issuing driver’s licenses to illegal immigrants. And the contest took a huge financial toll, as he spent all but $1.75 million of his $9.4 million haul by June 30.

On the Republican side, Gillespie had been expected to coast to an easy victory in a three-way contest. But he barely squeaked by, nearly losing to Trump-like provocateur Corey Stewart, chairman of the Prince William Board of County Supervisors.

The close call raised fears that Gillespie cannot connect with Trump voters — at the moment, the most energized slice of the Republican base. Republicans from the White House down have been questioning his campaign team and strategy. Adding to Gillespie’s woes: Stewart declined to endorse Gillespie and promised to keep overshadowing him by launching a bid against Sen. Tim Kaine (D-Va.) in 2018.

Gillespie spent far less than Northam on the primary. Gillespie had raised $6.7 million through June 30 and still had $3.2 million going into July.

The candidates have two more formal debates and seven additional joint appearances before November.