Iraq voted Wednesday in its first nationwide election since U.S. troops withdrew in 2011, with Prime Minister Nouri al-Maliki confident of victory and even offering an olive branch to his critics by inviting them to join him in a governing coalition.

But his optimism will do little to conceal the turmoil and violence that still stalk Iraq in the eight years he has held office, with the looming threat of the country sliding deeper into sectarian bloodshed and risking a breakup.

“Our victory is certain, but we are talking about how big is that certain success,” he said after voting in Baghdad.

“Here we are today, successfully holding the … election while no foreign troops exist on Iraqi soil. I call upon all the other groups to leave the past behind and start a new phase of good brotherly relations,” said al-Maliki, who faces growing criticism over government corruption and persistent bloodshed as sectarian tensions threaten to push Iraq back toward the brink of civil war.

The election was held amid a massive security operation, with hundreds of thousands of troops and police deployed across the country to protect polling centers and voters. The streets of Baghdad, a city of 7 million, looked deserted. Police and soldiers manned checkpoints roughly 500 yards apart, and pickup trucks mounted with machine guns roamed the streets that were otherwise devoid of the usual traffic jams.

Scattered attacks took place north and west of Baghdad, killing at least five people and wounding 16. Roadside bombs killed two women and two election workers in the northern town of Dibis.

Al-Maliki’s upbeat comments sharply contrasted with voters’ sentiments, which ranged from despair to a gritty resolve to participate despite the threat of violence.

“I see this election as the last chance, my last bet on Iraq. If things continue to be the same, I will leave, and this time for good,” said Saad Sadiq Mustafa, a 55-year-old retired army officer who fled with his family to neighboring Syria to escape the worst Sunni-Shiite violence of 2006 and 2007 and came home in 2008. A Sunni Arab and a father of four from Baghdad, Mustafa voted for Ayad Allawi, a secular Shiite who became Iraq’s first post-Saddam Hussein prime minister in 2004.

“We are living in a diverse country in which only seculars can maintain a balance between all ethnic and religious groups,” he said.

Al-Maliki’s State of Law bloc was widely expected to win the most seats in the 328-member parliament but fall short of a majority, according to analysts. That would allow al-Maliki to keep his post only if he can cobble together a coalition — a task that took nine months after the last election in 2010.

Even some of his onetime Shiite backers accuse him of trying to amass power for himself, but many in the majority sect see no alternative to the 63-year-old al-Maliki or are looking for a successor who would follow in his footsteps and jealously guard Shiite political domination.

However, al-Maliki enjoys the crucial support of Iran, which aides have said will use the vast influence it enjoys in Iraq to push discontented Shiite factions into backing him for another term.

Salam Ibrahim, a 25-year-old engineer and father of one, is a Shiite who places the sect’s interests above all else.

“I believe the main mission of the leader I am looking for is to continue fighting for the survival of the Shiite community and force those who oppose it to acknowledge its right to govern as the majority,” he said as he headed to vote in central Baghdad.