Iraq's Cabinet overwhelmingly approved a security pact with the United States on Sunday, ending prolonged negotiations to allow American forces to remain for three more years in the country they first occupied in 2003.

The deal detailing the conditions of the U.S. presence still needs parliamentary approval, and lawmakers could vote as soon as Nov. 24. For Iraqis, the breakthrough was bittersweet because they won concessions from the Americans but must accept the presence of U.S. troops until 2012.

"It's the best possible, available option," said government spokesman Ali al-Dabbagh. He was referring to the conflict between Iraq's desire for full sovereignty and control over security and its need for American support and cooperation to achieve that goal.

Al-Dabbagh described the pact — intended to supplant the U.N. mandate expiring Dec. 31 — as an "agreement on the withdrawal of U.S. troops," and Washington welcomed the Cabinet's approval.

"While the process is not yet complete, we remain hopeful and confident we'll soon have an agreement that serves both the people of Iraq and the United States well and sends a signal to the region and the world that both our governments are committed to a stable, secure and democratic Iraq," said Gordon Johndroe, spokesman for the White House's National Security Council.

There is a good chance parliament will pass the agreement with a large majority, since the parties that make up Prime Minister Nouri al-Maliki's coalition government dominate the legislature.

The pact was due to be completed by the end of July, but negotiations stumbled over parts pertaining to Iraqi sovereignty and judicial oversight.

Al-Dabbagh said Iraq's government has received U.S. assurances that the President-elect Barack Obama would honor the agreement, and pointed out that each side has the right to repeal it after giving one year's notice. Obama, who takes office in January, has said he would pull U.S. combat troops out of Iraq within 16 months of moving into the White House — or May 2010.

Iraq's neighbors and U.S. adversaries, Iran and Syria, oppose the pact, arguing that the immediate withdrawal of U.S. forces offered the best option for Iraq.

The Iraqi government sought to allay their fears, amending the document to prohibit the Americans from using Iraqi territory to attack neighboring nations.

The Cabinet's decision was made amid violence, despite a dramatic improvement in security over the past year. Fresh attacks underlined doubts about whether Iraq's nascent security forces can stand without U.S. military support and training.

Hours after the Cabinet vote, seven people died and seven were wounded in a homicide car bombing at a police checkpoint in Diyala, a turbulent province northeast of Baghdad, according to police Col. Ahmed Khalifa, chief of Jalula police station.

The U.S. military said the attack in Jalula occurred at a police station and that four police and six civilians died. There was no immediate explanation for the discrepancy in the reports.

Earlier Sunday, a roadside bomb killed three people and wounded seven in northern Baghdad, Iraqi authorities said.

Al-Dabbagh said all but one of 28 Cabinet ministers present in Sunday's meeting, in addition to al-Maliki, voted for the pact. The sole vote of dissent came from Minister of Women's Affairs Nawal al-Samaraie, a member of the Iraqi Islamic Party, the country's largest Sunni Arab party.

She said she voted against the pact because she preferred that it be put to a nationwide referendum. She also wanted the U.S. military to free Sunni security detainees not charged with specific crimes, rather than hand them to Iraqi authorities as provided by the agreement.

The Cabinet vote followed Washington's decision last week to grant a request by al-Maliki for final amendments.

Khalid al-Attiyah, parliament's deputy speaker, said the changes removed ambiguous language that could have allowed U.S. forces to ignore a timeline for their withdrawal from Iraqi cities by June 30, 2009 and from the country by Jan. 1, 2012. The changes also tightened Iraq's control over security raids and the arrest of Iraqis.

The agreement is believed to have met Iraqi concerns over its sovereignty and its security needs as it continues to grapple with a diminished but persistent insurgency. It gives Iraq the right to try U.S. soldiers and defense contractors in the case of serious crimes committed off-duty and off-base.

Al-Attiyah said he expected parliament to vote on the agreement by Nov. 24. If parliament approves the deal, President Jalal Talabani and his two deputies must ratify it.

Iraq's parliament is due to go into recess at the end of the month or in early December because of the Muslim Eid al-Adha holiday, when many lawmakers travel to Saudi Arabia on the annual pilgrimage.

Parliamentary speaker Mahmoud al-Mashhadani canceled all leave for lawmakers and suspended foreign and out-of-town visits to ensure a quorum for the security pact vote, al-Attiyah said.

"I'm optimistic that this agreement will be passed through the Council of Representatives (parliament)," spokesman al-Dabbagh told Associated Press Television News. But he added: "You cannot guarantee 100 percent approval of anything."

Barring unforeseen developments, the document should receive the support of the 85 lawmakers of the Shiite United Iraqi Alliance, the 54 Kurdish lawmakers and most of the 44 lawmakers in the Iraqi Accordance Front, the largest Sunni Arab bloc.

Radical Shiite cleric Muqtada al-Sadr, who commands the loyalty of 30 lawmakers, urged parliament in a statement Sunday to reject the agreement "without the least hesitation." The statement was read by a top al-Sadr aide on Iraq's al-Sharqiya Television.

Al-Sadr, whose militiamen battled U.S. forces in the past, has threatened to resume attacks on U.S. forces if they don't immediately withdraw from Iraq. He called for a mass prayer and protest in a central Baghdad square on Friday.

The Cabinet vote came a day after Iraq's most influential Shiite cleric, Grand Ayatollah Ali al-Sistani, indicated he would not object to the pact if it passes by a comfortable majority in parliament.