BAGHDAD - Iraqi politicians agreed a last-minute deal on Sunday to overcome divisions on a law needed for an election to take place next year, reducing the risks to U.S. plans for a partial withdrawal in 2010.

With 10 minutes till a midnight deadline for one of Iraq's vice presidents to cast a second veto of the law, deputies, badgered by U.S. and U.N. officials, voted unanimously to approve a compromise on the distribution of parliamentary seats.

Vice President Tareq al-Hashemi, a Sunni Arab, said he accepted the accord, which was voted on in a nail-biting session, and that he would run the dates of February 27 or 28 by the electoral authorities to see which would be most suitable.

The three-person presidency council, of which Hashemi is a part, would then set a date.

I have agreed to withdraw the veto, Hashemi said in a phone call to a television station.

The parliamentary election, which should have taken place by the end of January according to the constitution, is seen as a milestone in Iraq's young democracy as it emerges from bloodshed and U.S. control.

But disputes over the allocation of parliamentary seats reopened deep sectarian and ethnic divides between once dominant Sunnis, majority Shi'ites and minority Kurds that had only just started to heal after years of war triggered by the 2003 U.S. invasion.

The United States welcomed the Iraqi political accord.

This legislative action will allow Iraq to hold national elections within Iraq's constitutional framework. It is a decisive moment for Iraq's democracy and we congratulate the Iraqi people and their elected representatives, the White House said in a statement issued by the press secretary.

A substantial poll delay could have affected U.S. plans to end combat operations in Iraq by August 31, 2010, ahead of a full withdrawal by 2012. Delaying next year's partial drawdown could make a planned U.S. military build-up in Afghanistan harder.

This is wonderful and a huge achievement for Iraq. Now the way is paved to conduct the election at a date to be determined by the presidency council, said Khalid al-Attiya, deputy speaker of parliament.

VETO CONUNDRUM
Hashemi on November 18 vetoed the first draft of the election law because he felt it did not provide enough representation to refugees, many of whom are Sunnis, like him.

Deputies from the Shi'ite and Kurd communities then joined forces to pass an amended law that was seen as slap in the face to Hashemi because it reduced the number of seats allocated to Sunni areas. Hashemi had been expected to veto the law again, as a result.

But with the clock ticking on Hashemi's deadline for casting the second veto, parliament agreed on a redistribution of seats that he found acceptable.

All 138 deputies present accepted the compromise, according to parliamentary officials.

Under the deal, the number of parliamentary seats is increased to 325 from 275. It gave back to Sunni areas, such as the volatile northern province of Nineveh, seats that had been lost in the previous version of the law, and also added seats in Kurdish provinces.

A small group of Kurdish representatives, who had wanted more seats, complained that they had not actually voted in favor of the law but parliamentary speaker Ayad al-Samarai paid them no heed.

But other Kurdish leaders welcomed the compromise.

This is a victory for the political process. This law gets us out of the political impasse, said prominent Kurdish politician Aala al-Talabani.

(Writing by Mohammed Abbas and Michael Christie; Editing by Michael Christie)