Cantor, was supposed to cruise to victory in Tuesday's Republican primary over Dave Brat, an underfunded political novice who is an economics professor at Randolph-Macon College.
The only question was how wide Cantor's winning margin would be. Immigration advocates were watching intently, hoping that if it was big enough, Cantor would feel free to green-light action on immigration legislation in the House of Representatives.
Instead Cantor lost, decisively, after a campaign in which Brat made immigration the central issue. Brat accused Cantor of embracing ''amnesty'' and open borders, signed an anti-immigration pledge, and got assists in recent weeks from conservative figures popular with tea party voters such as radio host Laura Ingraham and columnist Ann Coulter, who labeled Cantor ''amnesty-addled.''
Cantor fought back, boasting in strongly worded fliers mailed to voters of shutting down plans to grant ''amnesty'' to ''illegal aliens'' - a changed tone for a lawmaker who'd spoken out in favor of citizenship for immigrants brought illegally to this country as youths.
He hardened his stance on the policy, moving to block House action last month on a Republican-authored measure offering citizenship to certain immigrants here illegally who serve in the military.
It wasn't enough.
After a primary election season in which immigration had barely registered, the outcome suggested that it can still be a potent political issue for Republican primary voters.
And Cantor's loss almost certainly ended whatever slim hopes remained for a deal on immigration in the House this year, likely putting the issue on ice until after the 2016 presidential election.
''It's really dead now,'' said Roy Beck, president of Numbers USA, a group that opposes comprehensive immigration legislation. Immigration ''has been pronounced dead many times over the last two years, but I think the voters of Cantor's district have sent an incredible message.''
Some immigration advocates and pollsters cautioned it was too soon to say whether immigration was the deciding factor for Cantor. David Winston, a pollster who advises House Republicans, said that had Cantor known he was truly threatened, he would have campaigned differently, possibly producing a different outcome. Instead, Cantor's internal polling had shown him comfortably ahead.
''Was that the key issue We don't know because the candidate never thought he was in a race,'' Winston said.
Immigration advocates also noted that Republican candidates who embraced immigration legislation escaped their primaries unscathed. Sen. Lindsey Graham, an author of the comprehensive immigration reform bill that passed the Senate last year with bipartisan support, won his primary handily Tuesday.
Another Republican House member, Rep. Renee Ellmers, also won last month even though her opponent attacked her as a supporter of relaxing immigration laws.
Some Democrats were still holding out hope for action. ''Now Mr. Cantor can do the right thing instead of the political thing,'' said Democratic Rep. Joe Garcia.
But Cantor's loss was such a stunning rebuke for a politician seen as next in line to be speaker of the House that it immediately emboldened conservative opponents of immigration legislation.
For a Republican House rank and file already reluctant to take on the politically volatile issue in an election year, the outcome offered an object lesson on the benefits of steering clear.
And for establishment Republicans who've been pushing support for an immigration overhaul as the best way for Republicans to win back the Latino voters crucial to national elections, Tuesday's result was a sobering setback. In the year since the Senate passed a comprehensive immigration bill, House Republicans have resisted the entreaties of the business community, religious leaders and the Republican Party establishment.
That doesn't look likely to change anytime soon.
''We're all shocked that you got the No. 2 Republican taken down and the entire campaign was on immigration,'' said Hector Barajas, a Republican consultant in California who is trying to sell the party to Hispanics. ''That emboldens the Ted Cruzes of the world to go out there and say `I told you so.''