The bespectacled college professor who toppled House Majority Leader Eric Cantor in a Republican primary Tuesday earned a masters of divinity from Princeton with a thesis on the philosophical doctrine of logical positivism. He was a rare breed of giant slayer: the kind that nobody saw coming.

“God acted through people on my behalf,” Dave Brat told Fox News after his win. “The issue is the Republican Party has been paying too much attention to Wall Street, and not enough attention to Main Street.”

When the votes were counted, he had racked up 56% of the vote in Virginia’s Seventh District, besting the No. 2 House Republican by about 7,000 votes. A former economic consultant at the World Bank with a Ph.D from American University, Brat also worked at the accountancy Arthur Andersen in Detroit and Chicago. He has chaired the Randolph-Macon Department of Economics and Business in sleepy Ashland, Va., since 1995.

Whatever the issue, it was a stunning victory. Brat’s candidacy wasn’t championed by powerful national conservative groups. His thin political resume is limited to civic activity in Henrico County, the Richmond-area suburbs that form Cantor’s base. He raised just $206,000, a mere fraction of Cantor’s $4.7 million haul. Scant polling had Brat trailing by double digits; in the waning stages of the contest, Cantor’s veteran campaign team touted an internal survey that showed the powerful incumbent’s lead hovering around 30 points.

But Brat was able to channel the grassroots frustration with Republican leadership. Much of his campaign was built on shopworn conservative boilerplate: cutting taxes, shredding Obamacare, enacting term limits and protecting the Second Amendment from looming threats. He cast Cantor as a weak-kneed leader who capitulated to Democrats and flagged in the battle to repeal the President’s health-care reform law. A photo on Brat’s website—which boasts an aesthetic reminiscent of the early-aughts—showed the incumbent with his hand over his heart, in conversation with a smiling Barack Obama.

The message was clear: Cantor had been in Washington too long, was too cozy with Democratic rivals, and had forsaken his conservative district to further his national ambitions. “Dave Brat is a smart dude,” marveled David “Mudcat” Saunders, a veteran Democratic consultant in the state. “It was a shoe leather campaign. It was the greatest of the grassroots. He knocked on doors, he got out there, he told his story. They just did a hell of a job.”

Brat also tried to paint Cantor, who is considered a cautious supporter of immigration reform, as an advocate of “amnesty.” The No. 2 House Republican vociferously rejected the label, and in fact had rejected Democratic pleas to bring up comprehensive immigration reform for a vote.

Tea Party groups, who have struggled in this year’s intramural skirmishes against mainline conservatives, touted the victory as a sign of the movement’s enduring strength. “The fact that an underfunded candidate like Dave Brat has upset the sitting Majority Leader in a primary is not only a statement that the Tea Party is alive and well,” said Daniel Horowitz of the conservative Madison Project, but also “a mandate for leadership reform, and a shot across the bow for the rest of the Republicans.”

Early signs suggest the state’s GOP leadership will coalesce around the unlikely victor. Pat Mullins, the chairman of the Republican Party of Virginia, lauded Brat as “highly-qualified, dedicated, and committed to the Commonwealth of Virginia and her people.”

Cantor, who can still opt to mount a write-in campaign, is only the second House Republican incumbent to lose a GOP primary this year. It was a defeat that nobody saw coming—except perhaps the little-known figure who authored the upset. “I think I’m peaking at the right time,” Brat said recently. And he turned out to be right.

-With reporting by Alex Rogers and Zeke J Miller

Write to Alex Altman at alex_altman@timemagazine.com.