House Majority Leader Eric Cantor, R-Va., announced Wednesday afternoon he will resign his leadership post and endorsed Kevin McCarthy of California to replace him.

"Effective July 31st, I will be stepping down as majority leader," Cantor told reporters after an emotional meeting of House Republicans in the Capitol. His defeat has already touched off a massive leadership scramble to replace him .

But Cantor said that he would back his fellow "Young Gun" McCarthy if he runs for leader with his "full support."

Cantor said his Jewish faith taught him that "each setback is an opportunity. ... I couldn't be more optimistic about the future of this country."

Cantor said he will be "a champion" for conservatives even though he will not be on the ballot.

He didn't reflect much on his defeat.

"I just came up short and the voters elected another candidate," he said. He has not decided what to do next, saying that would be between him and his wife.

But he also sought to buff his record and that of House Republicans.

He said there are a stack of bills sitting in the Senate that shows House Republicans get things done.

He touted his fights for school choice, medical research, and against Obamacare. And he also touted the reduction of spending for the first time since the Korean War.

He said his views on immigration — including the need to do something for people brought here as children — have not changed.

He also said that he looks forward to a productive June and July before relinquishing his post.