Ernesto Londono / The Washington Post

BAGHDAD — Ten years after the United States barreled into Iraq with extraordinary force and a perilous lack of foresight, the country is neither the failed state that seemed all but inevitable during the darkest days of the war nor the model democracy the Americans set out to build.

Haunted by the ghosts of its brutal past, Iraq is teetering between progress and chaos, a country threatened by local and regional conflicts with the potential to draw it back into the sustained bloodshed its citizens know so well.

The nation is no longer defined or notably influenced by its relationship with the United States, despite an investment of roughly $1.7 trillion and the loss of 4,487 American troops. In the end, Washington failed to carve out a role as an honest broker in postwar Iraq, an aspiration borne out of the recognition that the country's future may once again have explosive implications for the region.

The contrasts of today's Iraq are as sharp as they are dangerous. The autonomous Kurdish region in the north is thriving, inching ever closer to independence, buoyed by a lucrative oil boom and bold, ambitious leaders who have kept the region safe. The Shiite provinces in the south are enjoying a renaissance, reaping millions from improved security and the exponential growth of religious tourism.

Predominantly Sunni areas, meanwhile, are seething. The minority that enjoyed elite status under Saddam Hussein's autocratic reign now views itself as increasingly disenfranchised in the Shiite-run state of Prime Minister Nouri al-Maliki; its members have resorted to large-scale protests.

Drawing on Sunnis' widespread anger and frustration, remnants of Iraq's once-mighty insurgency remain a threat, periodically striking at the heart of the state.

Undercutting Iraq's quest to regain a seminal position in the region are the politics of Baghdad, which have become more intractable and poisonous since the U.S. military withdrew at the end of 2011. They have widened the country's ethnic and sectarian fault lines and called into question the viability of a parliamentary democracy in a country accustomed to strongman rule.

Pockets of the new Iraq are brimming with optimism. To drive around the southern province of Najaf, home to one of the most sacred shrines in Shiite Islam, is to behold the type of Iraq the United States once hoped to leave behind.

Cranes are ubiquitous as a construction boom reshapes the provincial capital. Struggling to accommodate the more than 2 million pilgrims who each year visit the Imam Ali Mosque, the holy site is adding wings. Najaf's streets are wallpapered with campaign posters for the upcoming provincial election.

The new Iraq looks far bleaker in predominantly Sunni regions in the west, the capital and provinces north of Baghdad — once the heart of the insurgency. Sunnis have seen their clout erode sharply, as they have gotten squeezed out of national politics and the government, by far the country's leading employer.

As the last American troops were leaving Iraq in December 2011, Maliki's security forces set out to arrest the country's Sunni vice president, Tariq al-Hashimi, whom authorities had accused of running death squads. The Sunni politician barely managed to flee the country and has resettled in Turkey, prevented from returning home by a death sentence imposed after his conviction in absentia on terrorism charges.

Wassfi al-Assi, a tribal leader in Kirkuk who has been active in protests, said Sunni Arabs in the north are as unnerved as they are disillusioned, fearing they will bear the brunt of the two conflicts.

“Iraq used to be one of the developed countries of the region,” he said. “Now we're seen as a Third World country. There are many calls for dividing Iraq, even more than during the occupation time.”