Nationalist cleric Moqtada al-Sadr, a long-time adversary of the United States, led in Iraq's parliamentary election with more than half the votes counted on Monday, the electoral commission said, in a surprise turn of fortune for the Shia leader.
In the first election since Islamic State was defeated in the country, Shia militia chief Hadi al-Amiri's bloc, which is backed by Iran, was in second place, while Prime Minister Haider al-Abadi, once seen as the front-runner, trailed in third position.
The preliminary results were based on a count of more than 95 per cent of the votes cast in 10 of Iraq's 18 provinces.
Unlike Abadi, a rare ally of both the United States and Iran, Sadr is an opponent of both of the countries which have wielded influence in Iraq since a US-led invasion toppled Sunni dictator Saddam Hussein in 2003 and ushered the Shia majority to power.
Sadr has led two uprisings against US forces in Iraq and is one of the few Shia leaders to distance himself from Iran.
Despite the election setback, Abadi might still be granted a second term in office by parliament and on Monday he called on all political blocs to respect the results, suggesting he was willing to work with Sadr to form a government.
"We are ready to work and cooperate in forming the strongest government for Iraq, free of corruption," Abadi said in a live televised address. Corruption has been the top of Sadr's agenda for several years.
Projecting himself as an Iraqi nationalist, Sadr has a zealous following among the young, poor and dispossessed, but he had been sidelined by influential Iranian-backed figures.
He can not become prime minister as he did not run in the election, though his apparent victory puts him in a position to pick someone for the job.
But even then his bloc might not necessarily form the next government since whoever wins the most seats must negotiate a coalition government in order to have a majority in parliament. The government should be formed within 90 days of the official results.
READ: Iraq declares curfew, recount in Kirkuk after 'illogical' vote count
Saturday's election is the first since the defeat of Islamic State, with the capture of its de facto capital Mosul, last year. The group overran a third of Iraq in 2014.
Turnout was 44.52 per cent with 92 percent of votes counted, the Independent High Electoral Commission said – that was significantly lower than in previous elections. Full results are due to be officially announced later on Monday.
Sadr and Amiri both came in first in four of the 10 provinces where votes were counted, but the cleric's bloc won significantly more votes in the capital, Baghdad, which has the highest number of seats.
A document provided to Reuters by a candidate in Baghdad that was also circulating among journalists and analysts showed results from all 18 provinces.
Reuters could not independently verify the document's authenticity but the results in it showed Sadr had won the nationwide popular vote with more than 1.3 million votes and gained 54 of parliament's 329 seats.
He was followed by Amiri with more than 1.2 million votes, translating into 47 seats, and Abadi with more than 1 million votes and 42 seats, according to calculations made by Reuters based on the document. Ex-Prime Minister Nuri al-Maliki, a close ally of Iran like Amiri, came in fourth with 25 seats.
Winning the largest number of seats does not automatically guarantee that Sadr will be able to hand-pick a prime minister. The other winning blocs would have to agree on the nomination.
In a 2010 election, Vice President Ayad Allawi's group won the largest number of seats, albeit with a narrow margin, but he was blocked from becoming prime minister for which he blamed Tehran.
And a similar fate could befall Sadr. Iran has publicly stated it would not allow his bloc to govern and may try to form a governing coalition between its allies, Amiri and Maliki.
"We will not allow liberals and communists to govern in Iraq," Ali Akbar Velayati, a top adviser to the Islamic Republic's Supreme Leader Ayatollah Ali Khamenei, said in February.
His statement, which sparked criticism by Iraqi figures, was referring to the electoral alliance between Sadr, the Iraqi Communist Party and other secular groups who joined protests organised by Sadr in 2016 to press the government to see through a move to stem endemic corruption.
Iraqi Communist Party Secretary General Raed Fahmy told Reuters the vote in favour of the Sadrist list, backed by his group, "is a clear message that we must have balanced relations with all (foreign countries) based on non-interference in Iraq's internal affairs."
"Everybody is welcome to provide support to Iraq, but not at the expense of its sovereignty and independence," he added.
During the campaign, frustrated Iraqis of all shades complained about their political elite's systematic patronage, bad governance and corruption, saying they didn't receive any benefits of their country's oil wealth.
"The importance of this vote is that it is a clear message that the people want to change the system of governance which has produced corruption and weakened state institutions," said Fahmy. "It is a message to provide services to the people, health and education, and to reduce social disparities."
Iraq has been ranked among the world's most corrupt countries, with high unemployment, rife poverty, weak public institutions and bad services despite high oil revenues for many years. Endemic corruption has eaten at the government's financial resources.
Fahmy told his party's website that Abadi was "closer" to Sadr's block than the other main contenders.
Sadr derives much of his authority from his family. Sadr's father, highly respected Grand Ayatollah Mohammed Sadeq al-Sadr, was murdered in 1999 for defying Saddam Hussein. His father's cousin, Mohammed Baqir, was killed by Saddam in 1980.
Celebrations erupted on the streets of Baghdad after the commission's announcement, with thousands of Sadr's supporters singing, chanting, dancing and setting off fireworks while carrying his picture and waving Iraqi flags.
Many of his supporters chanted "Iran out".
Whoever wins the election will have to contend with the fallout from US President Donald Trump's decision to quit Iran's nuclear deal, a move Iraqis fear could turn their country into a theatre of conflict between Washington and Tehran.
Abadi, a British-educated engineer who came to power four years ago after Islamic State seized a third of Iraq's territory, received US military support for Iraq's army to defeat the Sunni Muslim militant group even as he gave free rein to Iran to back Shia militias fighting on the same side.
If parliament does grant him a second term, Abadi will remain under pressure to maintain the balancing act between Washington and Tehran despite their tensions over the nuclear accord