Baghdad (AFP) - A fire ripped through Iraq's biggest ballot warehouse on Sunday ahead of a vote recount prompted by allegations of fraud during legislative elections that saw a surprise victory for a populist cleric.

A senior security official, speaking to AFP on condition of anonymity, said the fire broke out in a warehouse located in Al-Russafa, one of the largest voting districts in eastern Baghdad.

Firefighters brought the blaze under control several hours after it started, and the extent of the damage caused to ballot boxes was still unclear.

Around 60 percent of Baghdad's two million eligible voters had cast their ballots in the May election in Al-Russafa district.

A column of black smoke billowed from the warehouse, normally used to store foodstuff, and could be seen across the capital.

Warehouse staff ran out of the building carrying blue and white plastic ballot boxes to safety as firefighters backed by around a dozen trucks struggled to put out the fire, an AFP reporter said.

The cause of the fire was not immediately known.

The blaze comes as Iraq prepares for a manual recount of around 10 million votes, following allegations of fraud during the May 12 legislative polls.

The vote was won by populist Shiite cleric Moqtada Sadr's electoral alliance with communists, as long-time political figures were pushed out by Iraqi voters hoping for change in a country mired in conflict and corruption.

But the result was contested following allegations of fraud namely by the veteran politicians led by parliamentary speaker Salim al-Juburi.

- 'Most ballot boxes preserved' -

The recount was ordered by parliament on Wednesday at all polling stations, although no timetable has been announced.

According to intelligence services, tests of electronic voting machines -- used for the first time in Iraqi elections -- produced varied results, appearing to give credence to the fraud claims.

An electoral commission official and a spokesman for the interior ministry suggested Sunday's fire did not damage ballot boxes.

Story continues

"The room where voting machines and other election equipment were stored was destroyed by the fire," Imed Jamil, an electoral commission official for Al-Russafa, told AFP.

"The ballot boxes were stored in another room," he said, adding that the fire would not affect the recount.

Interior ministry spokesman General Saad Maan echoed him during a visit to the scene to the warehouse where the blaze was raging.

"Election material, including maybe ballot boxes, were burned but most of the ballot boxes were stored in another building and have been preserved," Maan told reporters.

Iraqis took to social media to discuss the fire, with some suggesting it was deliberately lit.

- 'They are burning votes' -

Fateh al-Sheikh, who ran and lost in the polls, went to the scene of the fire and cried foul.

"They are burning the votes of the Iraqi people. Those who tampered with the results are behind this fire," he shouted to anyone willing to listen.

Political analyst Essam al-Fili told AFP the blaze would only serve to fuel "a real crisis".

"Iraqis no longer trust all those (politicians) who have been around for years... because many of them are more interested in power than in the interests of the public," he said.

Last month's election saw a record number of abstentions as Iraqis snubbed the corruption-tainted elite who have dominated the country since the 2003 US-led invasion that toppled Saddam Hussein.

Less than half of Iraq's 24-million electorate took part, dumping the old guard in favour of Sadr's alliance followed by a list of former fighters of the Hashed al-Shaabi alliance that last year played a key role in the defeat of the Islamic State group.

But the old guard, dumped by Iraqi voters, have clamoured for a recount.

Experts have said it is unlikely that it would produce a major change in the number of seats won by their rival lists, but rather modify the rankings of candidates within the same lists.

On Wednesday, Iraq's outgoing parliament also sacked the nine-member independent commission which oversaw the polls, and on Sunday they were replaced by nine judges who would supervise the recount.

The previous week parliament had already voted to annul the ballots of displaced Iraqis and those living abroad, although they accounted for only a small fraction of the overall vote.