BAGHDAD, Iraq (CNN) -- Iraq's parliament on Sunday passed a long-awaited election law that the government said will allow national elections to take place in January.
Officials had hoped to hold elections January 16, but Iraq's election commission said Sunday the elections will take place later than that -- but before January 31, the constitutional deadline.
Iraqi Prime Minister Nuri al-Maliki, in a statement, called it "a historic victory of the will of the Iraqi people" and a "strong response against the terrorists and the former regime members who are trying to undermine security and undermine the political process and return the country to the dark ages, injustice, tyranny and discrimination."
President Obama called the step "an important milestone as the Iraqi people continue to take responsibility for their future." Speaking to reporters at the White House, he said Iraqi leaders' "flexibility and commitment to their country sends an important signal to the world about Iraq's democracy and national unity, and I look forward to prompt approval of this law by Iraq's presidency council."
The law has been the focus of great international concern, with United Nations and U.S. officials calling on Iraqi leaders to pass it. It was also widely seen as a test of Iraq's ability to form a functioning government.
Of the 196 ministers of parliament present Sunday, 141 voted in favor of the law.
But there was also contentious debate, which led Khalid al-Attiya, the parliament's deputy speaker, to threaten to adjourn the session.
Iraq's electoral commission had said it needed 90 days to prepare elections after a new law was passed. Even as the 90-day deadline passed in mid-October, officials continued to say they hoped for elections January 16.
A secure environment and political stability during and after the polls will be key as the United States looks to withdraw combat troops by next August, leaving 50,000 in advisory roles, and then withdraw all U.S. forces by the end of 2011.
The U.S. ambassador to Iraq, Christopher Hill, told CNN the election law "enables us to stay within the parameters" of the plan. But he said there are "people who are trying to cause problems and we have to deal with that."
Obama, in his remarks Sunday, said, "In the past several weeks we've seen that there are still those who would kill innocent men, women and children to deny the Iraqi people the future they deserve. Today's step forward is another reminder that these enemies of the Iraqi people will fail."
The biggest roadblock to the law has been the question of how balloting should unfold in the ethnically diverse, oil-rich province of Kirkuk, where Kurds displaced under Saddam Hussein's rule have returned to reclaim their land. The result is a power struggle among Kurds, Arabs and Turkmens.
Kurds have long regarded Kirkuk -- the province and the city of the same name -- as an integral part of Kurdistan, and many want it to be part of Iraq's autonomous Kurdish region. Arabs and Turkmens also lay claim to the city and province, and all the groups want their voices and votes to be adequately represented in the political system.
Disgruntled Arab and Turkmen residents say many more Kurds have moved into Kirkuk than were displaced, and that allowing them to vote would create an unfair advantage. Arabs and Turkmens want special measures to adjust for the increased numbers, because they believe many of the Kurdish immigrants are there illegally. The Kurds insist there should be no special voting procedures and reject a U.N. proposal that singles out Kirkuk for special treatment.
The disagreements among the groups spurred the postponement of provincial elections in Kirkuk last January because officials there could not agree on how to apportion seats among the ethnic groups.
Al-Attiya said Sunday the parliament reached a formula for the election law that was accepted by all the blocs.
Hill told CNN a vote will be held in Kirkuk, but that the election law will not solve the issue.
"Kirkuk will be solved by a political process which involves the good offices of the U.N.," Hill said.
Another key dispute holding up the law has involved lists to be used on election day.
Politicians disagree over whether to use open lists that name candidates or closed lists that name just their parties. The law used in the 2005 election calls for a closed list. The law that passed Sunday calls for open lists.
Al-Maliki called the use of open lists part of the "historic victory."