Iraq is set to stage a recount after last month's parliamentary election.
The fire took place at a Trade Ministry site in Baghdad where the election commission stored the ballot boxes from al-Rusafa, the half of Baghdad on the eastern side of the Tigris river.
Parliament has already ordered a recount of votes from the May election, in which the influential cleric Moqtada Al-Sadr was the biggest victor, after widespread allegations of voter fraud.
Al Jazeera's Charles Stratford reports from Baghdad.
Interior ministry spokesman General Saad Maan visited the scene and told reporters that "most of the ballot boxes were stored in another building and have been preserved".
"It is possible there were also some ballot boxes in the warehouse that caught fire, but most of the important boxes are in the three warehouses, where the fire has been controlled", he said.
Meanwhile, Iraq's Independent Higher Election Commission has announced that all the ballot boxes in the warehouse are safe.
Iraqis took to social media to discuss the fire, with some suggesting it was deliberately lit.
Before the parliament had acted, the electoral commission said it was voiding 1,021 ballot boxes from around the country, along with votes cast by Iraqis overseas and Iraqis still living in displacement camps that were set up during the battles against the Islamic State.
The political system is created to ensure that no one person or party can dominate, which leads to post-election discussions, a move that has not been interrupted by parliament's decision to recount.
Over 7,000 candidates contested the 329 seats in the parliament that will choose a new president, prime minister and government in Iraq.
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.
The turn out rate for Iraq's 24.5 million registered voters was the lowest since the first multi-party elections was held in 2005.
But the results have been marred by lingering allegations of voter fraud.
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.
Abadi's government on Tuesday said an investigation found serious violations and blamed the elections commission for a lot of them.
Salim al-Jubouri, the outgoing speaker of parliament, who lost his seat in the election, called for an entire redo of the vote because of the fire.
According to intelligence services, tests of electronic voting machines that were used for the first time in the elections produced varied results, appearing to give credence to the fraud claims. Mr Al Jabouri was not reelected during the May 12 vote.