In a shocking political defeat guaranteed to upend Republican Party politics, House Majority Leader Eric Cantor of Virginia lost his primary election Tuesday to a tea party newcomer who hammered the No. 2 leader for backing aspects of immigration reform.

Establishment Washington reeled from the moment the polls closed as Cantor, the ambitious leader with his sights on becoming the next House speaker, trailed Dave Brat, a local college professor who rustled for tea party support at a time when GOP leaders elsewhere have succeeded in halting the outsiders' ascent.

In the end, Brat claimed an easy victory over the seven-term incumbent in the Richmond-area district. The new nominee appeared as shocked as Cantor at the outcome.

"Can you believe it?" Brat said to his daughter, Sophia, according to the Richmond Times-Dispatch. "Unbelievable."

Cantor spoke with his wife, Diana, at his side at what was meant to be a victory party.

"Serving as the 7th District congressman and having the privilege to be the majority leader has been one of the highest honors of my life," he said.

The outcome was certain to not only ignite a leadership battle among the Republican majority in the House, but also to send a shudder though rank-and-file lawmakers who may become less willing to stray from tea party orthodoxy, particularly in the continuing debate over immigration reform.

"This stunning news could be the first shot in an all-out war between the establishment and tea party over leadership control," said GOP political strategist Ron Bonjean, a former top aide to Republican leaders.

The defeat of a congressional leader, especially one as prolific a fundraiser as Cantor, is almost unheard of. The loss — the first for a House majority leader — was the biggest electoral shock to the lower chamber since 1994, when Speaker Thomas Foley of Washington, a Democrat, was swept out of office in the GOP tidal wave that ushered in Republican control. More recently, Democratic Sen. Tom Daschle of South Dakota was ousted as Senate minority leader in 2004.

"This is the political version of the San Francisco earthquake," said Stuart Rothenberg, who publishes the Rothenberg Political Report, a nonpartisan analysis of elections. "It came out of nowhere."

But in retrospect, the signs were evident. Cantor's team had become increasingly concerned about the primary challenge from Brat, in part because the district had recently been redrawn and leaned further to the right.

A raucous political meeting earlier in the campaign season made headlines as voters expressed their discontent over Cantor's leadership in the House, even after the majority leader had worked to curry favor with tea party lawmakers.

The willingness of GOP leaders to negotiate an end to the government shutdown last fall, rather than hold out for a long-shot repeal of President Obama's healthcare program, turned off the most conservative of Republicans both in Washington and at home.

Even more, Cantor's support for providing citizenship for young immigrants — he had promised but never delivered on a bill that would accomplish that goal — became a rallying cry of opposition from those who called it "amnesty."

Cantor, part of a new generation of Republican leaders who called themselves Young Guns, reacted in full force in recent weeks. He pummeled the airwaves, spending more than $5 million on the race, including a direct-mail piece that took a harder line against immigration reform than he previously had.

In many ways, however, the show of force gave more oxygen to Brat, an economics professor at Randolph-Macon College who had few resources and almost no outside cash to aid his underdog effort. To Cantor's millions, Brat raised only $200,000, and spent even less, according to the Center for Responsive Politics.

Cantor's loss excised the top-ranking Republican official in Virginia, a perennial battleground in presidential years that presently has no statewide GOP officeholders. But the national import will probably be on the immigration issue. Among advocates for changing the law, the defeat is likely to quash any remaining hope for House action on legislation to provide a citizenship path for some immigrants.

Many had expected that the chamber might turn to the issue once primary season ended and lawmakers no longer had to worry about protecting their right flank.

Still, some suggested that opportunities remain for Republicans to move forward on immigration, and they took heart in Tuesday's primary success of South Carolina Sen. Lindsey Graham, a GOP architect of immigration reform.

"Too bad Rep. Cantor didn't steal a page from Sen. Lindsey Graham, who leaned into the issue, was unapologetic about his principled stand and won his primary handily," said Frank Sharry, executive director of the immigration advocacy group America's Voice.