Jim Napoli often cringes at the way Virginia Republican Corey A. Stewart’s Senate campaign has gone — his bombastic Twitter posts, his unwavering fealty to President Trump and the suggestions he has ties to white supremacists.

“I think he’s better than that,” said Napoli, president of a homeowners association in Prince William County. “He could have run on the strength of his leadership in Prince William County and what he’s done here.”

Voters like Napoli have elected Stewart four times as chair of the county’s board of supervisors, even as the increasingly blue Northern Virginia community has supported Democrats in recent statewide elections, giving Tim Kaine (D) 58 percent of its vote in the 2012 Senate race.

While doubtful of Stewart’s chances for success against Kaine in November, Napoli plans to vote for the Republican for reasons that have little to do with his Senate campaign promises to fight illegal immigration, preserve Confederate monuments or generally carry out Trump’s agenda.

It was Stewart who championed a $300 million county transportation bond issuance approved by voters in 2006 that is still paying for improvements along Route 1 and other traffic-choked roads in the fast-growing county of 456,000 residents.

Stewart was also behind dozens of new baseball fields, soccer pitches and swimming pools in Prince William, many paid by developers through proffer arrangements.

And while to some his language on the campaign trail has at times bordered on xenophobia, Stewart was instrumental in the approval of a new mosque last year that was opposed by hundreds of residents in a rural portion of western Prince William.

As Stewart grapples with controversy and trails Kaine by as many as 20 points in most polls, some local supporters wonder: Where has that other Corey Stewart been?

“The image that people in Prince William County have of Corey Stewart is much different than the one you’ve seen emerging with the Senate race,” said Supervisor Pete K. Candland (R-Gainesville), a frequent ally of Stewart’s on the Republican-controlled county board.

“He’s really targeted all those things that families are concerned about: traffic, parks, capital improvements, quality-of-life things, and he’s been able to get the money to build those things,” Candland said. “That Corey Stewart is different than what people outside the county know.”

Stewart has sometimes highlighted his record in Prince William while campaigning, usually focusing on the fact that the county’s real estate tax rate — $1.125 per $100 of assessed value — is among the lowest in Northern Virginia while officials deal with traffic congestion and crowded schools.

More often, he will return to the local frustrations over illegal immigration that thrust him into the national spotlight in 2006.

Back then, the county was passionately divided over a resolution that, initially, directed police to check the status of anyone suspected of being in the country illegally, a fight Stewart championed on his way to winning that year’s special election to replace retiring board chair Sean Connaughton. The county policy was later amended to apply to anyone arrested by police.

Stewart said talking about crimes committed by undocumented immigrants and the preservation of Confederate monuments resonates most with conservative voters who helped him win the GOP Senate nomination in June. Highlighting those problems also gets him the most press, he said.

“I could talk about roads and schools and the economy all day long,” Stewart said. But, he added, “when I think about ‘What am I going to campaign on?’ a lot of it depends on ‘What does the press pick up on?’ ”

Kristen Perper, 50, said she’s not particularly passionate about those more divisive issues, though she agrees with Stewart’s positions.

What won her over was the time in 2015 when Stewart showed up to her local park in Nokesville to throw out the first pitch on opening day for Little League baseball after he helped secure $875,000 in improvements that included new stadium lights.

Perper said she approached Stewart with stories of how, without lights in their park, the teams would have to travel to other parks as far as 30 miles away for games scheduled to last past sunset. After home games in the fall ran late, parents often scrambled for flashlights to find bats, balls and other equipment, she said.

“He totally got it,” Perper said, calling his pitcher’s-mound appearance “really important” to the community. “He’s somebody who, when he gets an idea in his head, he’ll go all in if he believes in it.”

Nathan Mowery, 28, said he was impressed with how Stewart handled a controversial vote over a proposed mosque in Gainesville last year.

The project drew opposition from residents worried about the extra mosque traffic on already clogged local roads — and ignited Islamophobia among others.

Stewart might have gained easy political points by joining the opposition — including the two Republican supervisors representing the area — given that the mosque plan required a special-use permit to connect to the local sewer lines.

Instead, during an emotional board meeting that lasted until 3:30 a.m., Stewart reminded his colleagues that — since the board had previously approved similar special-use permits for churches — the county could be sued for religious discrimination if it rejected the mosque.

“This is not a normal land-use hearing,” he told his fellow supervisors. “We are limited here by the federal law.”

After the sewer-line permit was still rejected in a 4-to-4 tie, Stewart backed a motion to reconsider the vote. He then suggested that Supervisor John D. Jenkins (D-Neabsco) vote yes — with opponents in the audience yelling “Don’t tell him how to vote!” — and the project was approved 5 to 3.

The maneuver generated a short-lived recall campaign targeting Stewart and a lawsuit against the mosque project that also went nowhere.

For Mowery and other Muslims who plan to pray at the mosque, it created goodwill in the community that recently allowed Stewart some leeway when, according to Stewart, a campaign contractor with access to his Twitter account tweeted an anti-Muslim remark.

“There are policies he has that I don’t always agree with, but when it comes to actually counting the times that Corey Stewart has stood up for the Muslim community and the times Tim Kaine has, I would actually count Corey Stewart as a more prominent supporter,” Mowery said, adding that he is still unsure how he will vote in November.

Napoli also watched Stewart work the levers of county government on behalf of his community, the Somerset Crossing development of 524 homes near Gainesville.

During a fight over where Dominion would build transmission lines to accommodate a new data-center complex in the area, Stewart’s office blocked Dominion from using 55 acres of wetlands owned by the Somerset development, by arranging for the county to acquire the property as open space — protecting it from federal eminent-domain proceedings Dominion would have to use.

Dominion won state approval earlier this year to partially bury its lines beneath Interstate 66 after Stewart and local homeowners also fought against proposed routes through other communities.

“It wouldn’t have happened without Corey and his team,” Napoli said.

Still, Stewart has plenty of detractors in Prince William.

Elena Schlossberg — who as head of the Coalition to Protect Prince William County worked with Stewart in the Dominion fight — called him “an actor” on the campaign trail who will adopt whatever policy positions he thinks will get him elected.

“When he is on the county board, he finds himself in a position where he actually has to be reasonable,” Schlossberg said.

During a recent board meeting, Stewart sat through presentations, joking with the presenters and, in between, trying to cajole a few of his colleagues into backing another transportation bond issuance.

One county contractor shared the results of a new residents survey that showed 56 percent of respondents reported being “extremely satisfied” with county services.

Stewart won some laughter after deadpanning: “I couldn’t hear you. Can you say that again?”

Meanwhile, his supporters and critics were having it out on Twitter over a few posts he had written just before the meeting.

One featured a stock photo of shirtless Latino gang members looking menacingly into the distance. Another highlighted a conservative website’s article about illegal immigration, showing migrants climbing a border fence.

“This WILL end, after we #FireTimKaine on November 6,” Stewart wrote, generating 1,100 likes.