Speaker Kevin McCarthy US House of Representatives votes
In the lower chamber of Congress, the congressman was removed as leader of the Republican majority by 216-210 votes.
After he struck a deal with Senate Democrats to fund government agencies, hardliners in his party voted against him.
The House Republican majority has no obvious successor. On Monday night, Republican Matt Gaetz, a Trump ally, filed a rarely used procedural tool called a motion to vacate to remove McCarthy from his post.
During negotiations to avert a partial government shutdown at the weekend, he accused the Speaker of striking a secret deal with the White House to continue funding for Ukraine. McCarthy denies the charge.
During a private meeting of Republican lawmakers on Tuesday evening, Mr McCarthy told colleagues he would not run for Speaker again.
Later, he accused his political nemesis, Mr Gaetz, of attention-seeking.
McCarthy said fundraising emails sent by Mr Gaetz during the infighting were “not becoming of a member of Congress” and “had nothing to do with spending.”
McCarthy said the hardliners who ousted him are not conservatives.
As Mr Gaetz and other right-wingers refused to support him, he only became Speaker in January.
Only eight Republicans voted to oust McCarthy on Tuesday afternoon. A total of 210 lawmakers – all Republicans – supported him.
Nevertheless, Democrats sided with Republican defectors to remove the Speaker.
Nancy Mace, a moderate Republican, voted against McCarthy, surprising many.