Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

In a stunning upset, Virginia Rep. Eric Cantor, the second-highest ranking Republican in the House, lost his primary challenge to a tea party-backed candidate Tuesday, according to the Associated Press.

Economics professor Dave Brat defeated Cantor to become the GOP nominee for Virginia’s 7th congressional district.

Cantor, who serves as the House majority leader, heavily outspent Brat and was widely expected to survive the challenge from the right.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Sign up for breaking news alerts from NBC News

Brat painted the seven-term congressman as a Washington insider who has become too liberal to represent the Richmond-area district. He accused Cantor of supporting immigration reform that would give “amnesty” to those living in the United State illegally.

Cantor became the highest-ranking member of the House to be defeated since then-Speaker Thomas Foley lost his re-election contest in 1994.

In brief remarks to supporters Tuesday night, Cantor said serving Congress "has been one of the highest honors of my life."

"I know there’s a lot of long faces here tonight, and it’s disappointing, sure," Cantor said. "But I believe in this country, I believe there’s an opportunity around the next corner for all us."

Brat’s victory illustrates the enduring power of conservative activists who think Republicans in Washington are ineffective and are determined to unseat them.

Brat’s attacks on Cantor for his past remarks that the GOP needed to reach a deal with President Obama on the issue, will likely stall any chance of a broader immigration bill passing in Congress, as other Republicans will worry about being defeated in primaries like Cantor.

And Cantor’s loss will start jockeying in the House of Representatives among members who want to replace him in the party’s leadership and position themselves to become Speaker if John Boehner retires.