But he did admit that much of his message is designed to outrage — to win attention in the news media and to overcome a lack of money in the bank.

“I am deliberately edgy, I’m not going to deny that,” he said. “To win a successful campaign against an opponent that has a lot more name recognition and a lot more money, I have to be edgy.” (Asked if he indeed saw himself in the White House someday, he said: “I’ll be happy with Senate. And we have a great president.”)

Mr. Stewart looks unlikely to defeat Senator Tim Kaine, who has more than $10 million on hand and is popular in Virginia. But he could impair the Republican ticket and brand — he has vowed to “kick Tim Kaine’s teeth in” — in his determination to pursue a bomb-throwing strategy in a state that has rapidly shifted from reliably red to safely blue because of the very demographic shifts he outlined in 2016 at what had been Mills E. Godwin Middle School.

[For more coverage of race, sign up here to have our Race/Related newsletter delivered weekly to your inbox.]

Mr. Stewart, 49, has long eyed higher office. “I’m an ambitious fellow, I’ll be frank about that,” he said in 2011, when he was considering an earlier Senate race. And as he pursued those ambitions, he has become a very different kind of politician than when he first ran for local office: an immigrant’s husband who has bashed undocumented immigrants and embraced white nationalists; a Midwesterner who attended Confederate flag-bedecked balls and defended the controversial rebel statues in his adopted state; and an aspiring politician who has turned on his party’s leaders, deeming them “flaccid” and unable to please their wives.

While Mr. Stewart’s nomination for Senate was his third try for statewide office in five years — he ran for lieutenant governor in 2013 — he has found more success in local politics. He has repeatedly won election as a county supervisor on issues like promoting development and building ball fields. But his post in Prince William is also where he discovered the potency of racial politics.

Once a sparsely populated enclave and political backwater, Prince William County — 30 miles southwest of Washington — has grown at a torrid pace in recent decades as families in search of good schools and a front yard pushed into the exurbs.