Republican gubernatorial candidate Ed Gillespie, right, gestures as he participates in a tea party debate with Corey Stewart, left, and state Sen. Frank Wagner, center, at Goochland High School in Goochland, Va. (Steve Helber/AP)

Virginia Republicans’ awkward relationship with President Trump was on display Saturday in a debate among the three candidates vying for the GOP nomination for governor.

As a tea-party-sponsored debate just outside Richmond wound down, and following some predictable clashes over cutting taxes, the question became whether front-runner Ed Gillespie doesn’t like Trump enough, or whether brash challenger Corey Stewart loves him too much.

Stewart, chairman of the Prince William Board of County Supervisors and a onetime Virginia leader of the Trump campaign, accused Gillespie of being insufficiently committed to the president. He cited Gillespie’s reluctance to support Trump last fall after a 2005 video was unearthed in which Trump was recorded making lewd remarks about women on the set of the TV show “Access Hollywood.”

“In the wake of the ‘Access Hollywood’ scandal,” Stewart said, “Ed was among the first Republicans in the country to kick him when he was down. . . . You refused to be anywhere near Donald Trump and refused to be on his leadership committee.”

Gillespie, a longtime Republican consultant and former adviser to President George W. Bush, at first avoided addressing his feelings toward Trump. “I supported our ticket as I always support Republican tickets,” he said.

As he went on to call for party unity and mentioned times he had introduced Vice President Pence at public events, someone in the crowd of about 275 tea party activists yelled out, “What about Trump?”

Finally, Gillespie responded: “I did take exception to the comments he made in the ‘Access Hollywood’ tape,” he said, mentioning that he has a wife and two daughters. “Corey’s the only one who thinks they’re great comments,” he said, as some in the crowd booed and others cheered. “I want to make sure we try to respect all Americans, and I found those comments to be offensive.”

The exchange, which left third challenger state Sen. Frank W. Wagner (R-Virginia Beach) looking on bemusedly, provided drama in a one-hour debate that otherwise featured familiar positioning on issues of taxes, immigration and the economy.

The event was sponsored by the Virginia Tea Party Patriots, a coalition of tea party groups from across the state, and featured questions submitted in advance by group members or state Republicans.

As they did in a debate a week ago in Lynchburg, Stewart and Wagner spent a chunk of time slamming Gillespie’s plans for an across-the-board 10 percent tax cut. Stewart claimed Gillespie would not make enough budget cuts to afford such a measure, and Wagner painted it as unrealistic.

Wagner, a 25-year veteran of the General Assembly, was particularly pointed in questioning Gillespie’s math, noting that the tax plan claims a yearly savings of $1,300 for an average Virginia family.

Based on current rates, though, Wagner calculated that to realize those savings, a family would need an income in excess of $200,000 a year. “That’s the kind of deceptions I’ve heard over and over in this campaign — baiting voters with things that aren’t true,” Wagner said.

“Ed, be honest with the public,” Wagner said, adding that most Virginians never see that much money. “Maybe your average families do in Washington, D.C.”

Gillespie is a ripe target for his opponents because he has far outraised them in cash and has locked up endorsements all over the state, including a new one he announced Saturday from Prince William County Sheriff Glendell Hill. The sheriff initially had endorsed Stewart but switched to Gillespie.

Stewart’s attacks were by far the most vicious. He alluded only briefly to the issue of preserving Confederate flags and monuments around the state, which he has made the centerpiece of his campaign, saying he would “stand up for our heritage.” But he closed with an aggressive put-down of Gillespie, who in 2014 failed by the thinnest of margins to unseat Democratic Sen. Mark R. Warner.

“I know controversy, and I know a lot of weak-kneed Republicans don’t like it. That’s tough,” Stewart said, and as supporters began to cheer he added: “Weak-chinned, weak-jawed establishment Republicans. . . . He lost,” he said, referring to Gillespie, “because he has no leadership skills. He’s wishy-washy. . . . If you’re looking for a winner, I’m your candidate.”

Supporters responded with chants of “Cor-ey! Cor-ey!”

But it wasn’t enough. In a straw poll taken before and after the debate, Gillespie won with 125 votes to 79 for Stewart and 20 for Wagner. Fourteen were undecided.

The three are campaigning ahead of a June 13 party primary. The Democratic candidates are Lt. Gov. Ralph Northam and former congressman Tom Perriello, who also face a primary that day.