BAGHDAD — Iraq presents Barack Obama with the complicated task of bringing troops home from a deeply unpopular war and determining the role America will play as the devastated country struggles to rebuild.
American forces are slated to pull out of Iraq's cities by June and leave Iraq by the end of 2011, according to a yet-to-be ratified security agreement between the two countries. The U.S.-led invasion began nearly six years ago and has resulted in 4,190 American deaths.
But it is how the troops leave, and the state of the country they leave behind, relatively secure or chaotic, that is sure to be one of the biggest foreign policy challenges facing the new administration.
U.S. officials say determining the level of stability in Iraq depends on the much anticipated provincial elections scheduled for late January. Those elections, along with national elections in late 2009, could either push Iraq's religious and ethnic groups toward an elusive reconciliation or further divide them.
The elections will feature political races heavily influenced by Iraq's complex and sectarian conflicts.
They could exacerbate tensions in southern Iraq between U.S.-backed Prime Minister Nouri Maliki's nationalist Islamic Dawa Party and the Supreme Islamic Iraqi Council, the two main Shiite Muslim parties in the country.
The results of the internal Shiite rivalry are likely to determine whether Iraq is broken up into semiautonomous regions or retains a strong central government. The Supreme Islamic Iraqi Council wants to push for the creation of a nine-province federal region, which Dawa fears could jeopardize Iraq's unity.
"Much is at stake in Basra and other oil-bearing governorates," said Joost Hiltermann, an expert on Iraq for the International Crisis Group think tank. "And Baghdad is the prize for those who seek the restoration of strong central government in Iraq."
A brief tour of some of the provinces:
In Baqubah, the capital of Diyala province, buildings are pockmarked with bullet holes, a reminder of the failures of the election in January 2005.
Most Sunni Arabs stayed home from the polls then, angry about the U.S. invasion and the policies that followed. But the boycott is now viewed as the Sunnis' biggest blunder.
In Baqubah, like Baghdad and Mosul, the election results, which gave a disproportionate majority to other religious and ethnic groups, helped fuel violence.
Now the province's Sunnis are mobilized to vote, but worried about the Shiite-led government. They regularly accuse Baghdad of trying to sabotage the Sunnis in the province.
Former Sunni insurgents known as the Sons of Iraq, who are credited with fighting Al Qaeda in Iraq, are wanted for arrest. Inside his fortified compound, Gov. Raad Tamimi makes it clear that he thinks the Shiites will win a majority in Diyala, despite Sunni claims that they make up a larger percentage of the population.
For four years, the Baghdad provincial council has been dominated by Shiite religious parties. Until this year, the municipality regularly frustrated U.S. officers who sought better services for Sunni areas. The shortages of electricity and water stemmed in part from the dangers associated with Sunni enclaves and in part from sectarian bias.
New Sunni politicians, ascendant from the Sons of Iraq movement, hope to change the equation. They have partnered with established Sunni parliamentary blocs such as the Iraqi Accordance Front, to gain seats.
Col. Raad Ali, a member of the Sons of Iraq in the western district of Ghazaliya, has joined a slate with secular parliament member Saleh Mutlak.
"This election is too important. This time it is to be or not to be. We can't let these religious parties rule us. We have suffered enough," Raad said. "We think if we get in power we can judge them for their crimes before and rebuild. This is a secular country. We have had enough from the religious parties."
Another potential hot spot will be in the south, where Dawa and the Supreme Islamic Iraqi Council will be pitted against each other.
"We have the ability and ambition to win in the next elections," said Furat Shara, the head of the Iraqi Council in Basra.
Dawa has been boosted by Maliki's performance since the spring, when he ordered the Iraqi army to wrest control of Basra from militias and criminal gangs. His party is staunchly opposed to the Iraqi Council's vision of a giant southern federal region.
"We think the central government's jurisdiction should be wider and stronger than the provincial government. The unity of Iraq depends on the central government," said Ali Alaaq, a Dawa lawmaker.
The election results could determine whether the Iraqi Council pursues its vision of a strong federal region, or gives up its quest, faced with Maliki's surging popularity.
Nowhere are the stakes higher than Nineveh province in northern Iraq.