The resignation of Sunni speaker Mahmoud al-Mashhadani capped a long-running power struggle with Shiite and Kurdish lawmakers and even members of his own party. Lawmakers applauded his announcement, quickly approved it, then passed a measure allowing Britain's 4,000 troops and several smaller contingents from other countries to stay through July.
"I do believe that I was faithful to doing good work," al-Mashhadani said in his address to the chamber where he often offended other lawmakers. "If I caused hurt to you, I ask your forgiveness."
The authorization for foreign troops became entangled in al-Mashhadani's quarrel with Kurdish and Shiite lawmakers last week, when he shouted insults at some of them and threatened to resign because "there is no honor in leading this parliament."
His opponents ultimately forced him to keep his word. As a negotiating ploy, al-Mashhadani tried to delay until Jan. 7 the vote on the troops resolution a week after the Dec. 31 expiration of the U.N. mandate authorizing the presence of foreign troops in Iraq.
The new measure will allow non-U.S. military personnel to stay through and assist American soldiers until the end of July. The Americans can remain until the end of 2011 under a separate security agreement.
Britain has already said it plans to withdraw its 4,000 troops from southern Iraq by the end of May. Australia, El Salvador, Estonia and Romania also have troops in Iraq but much smaller contingents. El Salvador President Tony Saca said Tuesday he will withdraw his troops from Iraq after Dec. 31.
Al-Mashhadani has long been at the center of arguments in the legislature because of his erratic behavior and abusive language.
Two years ago, the Shiite bloc ousted al-Mashhadani after a series of outbursts, but his fellow Sunnis forced his reinstatement. Al-Mashhadani also clashed with Kurdish legislators earlier this year in a dispute over the oil-rich city of Kirkuk.
Al-Mashhadani told lawmakers in behind-the-scenes negotiations that in return for his resignation he wants to be named head of a human rights association, Shiite lawmaker Reda Jawad Taqi told The Associated Press before Tuesday's session convened.
The speaker also wanted a guarantee that his post would be filled by someone from a party other than his own Sunni Iraqi Islamic Party, with which he is also feuding, Taqi said. The speaker's post is usually held by a Sunni and there are a number of Sunni parties in parliament.
It was not immediately known if the lawmakers agreed to the concessions sought by the speaker in exchange for stepping down. He retires from his parliament seat with a full pension.
The speaker will be temporarily replaced by one of his two deputies. The main Sunni party will then choose a replacement after parliament convenes following Christmas and a number of Islamic holidays.
Also Tuesday, nearly two dozen police and security officials allegedly arrested on suspicion of forging identity cards and badges were released on bail, security officials said.
The men originally were reported to have been arrested for conspiring to restore Saddam Hussein's outlawed Baath party and planning a coup. But the government subsequently denied there was any conspiracy.
The security officials said those arrested were released while an investigation proceeds, without specifying whether they will be charged. The two officials spoke on condition of anonymity because they were not authorized to speak to news media.
Elsewhere in Iraq, four policemen were killed and three others injured in bomb explosion in Tarmiyah, 30 miles north of Baghdad, an officer said on condition of anonymity as he was not authorized to speak to the media.
The U.S. military said four policemen and one civilian were killed in the incident. Conflicting information on attacks in Iraq is common.