US House Majority Leader Eric Cantor has lost a Virginia Republican Party primary election to a challenger from the party's populist Tea Party wing.
Little-known economics professor David Brat defeated the second-ranking House of Representatives member 56%-44%.
"This is a miracle from God," Mr Brat said, as his allies among conservatives cheered the result.
Mr Cantor had been widely favoured to win, having raised significantly more money than Mr Brat.
But the election appears to have exposed dissatisfaction with Mr Cantor, first elected in 2000.
But Mr Brat attacked Mr Cantor's record, including his support for some immigration reforms, and rallied enthusiastic members of the anti-tax, conservative populist Tea Party movement in the low-turnout race.
He also won despite the majority leader raising $5.4m (£3.2m) for his campaign. Mr Brat raised less than $300,000.
As he conceded on Tuesday evening, Mr Cantor said the election was "disappointing, sure".
"But I believe in this country. I believe there's opportunity around the next corner for all of us."
Analysis in the US media
There's a famous saying by former Speaker of the House Tip O'Neil that "all politics is local".
In the end, Mr Cantor could be out of a job because he took his home-state constituents for granted.
"Cantor let his guard down by focusing on the intrigues of the Capitol and neglecting the demands of district service, constituent contact and visible fealty to local priorities," writes NPR's Ron Elving.
Democrats jumped on the unexpected defeat as a positive sign for their own chances of regaining control of the House of Representatives this year.
"Eric Cantor has long been the face of House Republicans' extreme policies, debilitating dysfunction and manufactured crises," Minority Leader Nancy Pelosi said in a statement.
"Tonight, is a major victory for the tea party as they yet again pull the Republican Party further to the radical right. As far as the midterm elections are concerned, it's a whole new ballgame.''
Analysis by Mark Mardell, BBC News, Washington
The defeat of the second-most-important Republican in the House at their hands is being variously described as an "apocalyptic moment" and "an earthquake".
I am not sure the Earth has moved for me, but it will make senior Republicans worry they are still on shaky ground.
The victory of the apparently underfunded and little known Prof David Brat will send a message.
The truth is the Tea Party are a force to be reckoned with still.
They've pushed their party to the right, dominated its council for years, and they won't go away after the mid-terms in November.
In a forewarning of trouble, last month Mr Cantor was booed at a meeting of Republican activists after a local party chairman whom he supported was removed in favour of a Tea Party candidate.
A lawyer, Mr Cantor, 51, was first elected to Congress in 2000 after serving nine years in the Virginia House of Delegates.
After the Tea Party emerged in 2009, he forged ties with the loose-knit movement, drawing on its support to help the Republicans take control of the House of Representatives the following year.
Mr Cantor was seen as representing a more conservative counterweight to House Speaker John Boehner, seen by some in the Tea Party as too conciliatory to Democratic President Barack Obama.
He was even viewed by some as possible successor to Mr Boehner.
In a statement, the house speaker said Mr Cantor is a "a good friend and a great leader, and someone I've come to rely upon on a daily basis".
Mr Brat will now face Democratic nominee Jack Trammell - also a professor at Randolph-Macon College - in November's general election.
Primary elections were staged in five states. In other results:
- US Senator Lindsey Graham defeated six challengers from the Tea Party to win South Carolina's Republican primary, avoiding a runoff vote
- Incumbent South Carolina Senator Tim Scott, the only Black Republican in the chamber, won his primary with more than 90 percent of the vote
- Tea Party favourite Bruce Poliquin beat Kevin Raye in the Republican primary in Maine's northern rural district. Emily Cain won the Democrat nomination
- Brian Sandoval beat off four challengers to take Nevada's Republican primary for governor.