Lebanese security officials who were concerned about the massive stockpile of ammonium nitrate in Beirut’s port had sent a letter to the country’s prime minister and president two weeks before the blast, warning that the material “could destroy” the capital city if it exploded, a report says.

The letter had summed up the results of a judicial investigation launched in January surrounding the 2,750 tons of highly-explosive material being kept there, Reuters reported, citing a senior security official. The ammonium nitrate ended up exploding following a fire on August 4, killing at least 220 people, injuring more than 7,000 others, and left an estimated 300,000 people homeless.

“There was a danger that this material, if stolen, could be used in a terrorist attack,” an official involved in writing the letter told Reuters.

TREY YINGST REPORTS FROM LEBANON AFTER PRIME MINISTER, CABINET RESIGN

“I warned them that this could destroy Beirut if it exploded,” he added.

Reuters could not independently confirm the contents of the letter, but a representative for Prime Minister Hassan Diab said his government acted immediately upon receiving it.

“The current cabinet received the file 14 days prior to the explosion and acted on it in a matter of days,” the official told Reuters. “Previous administrations had over six years and did nothing.”

Diab and his Cabinet resigned Monday in the wake of the explosion's fallout.

President Michel Aoun, meanwhile, said last week he was aware of the ammonium nitrate in Beirut and ordered security and military agencies under his watch to take care of the issue, Reuters reports.

“[The state security service] said it is dangerous. I am not responsible! I don’t know where it was put and I didn’t know how dangerous it was,” the news agency quoted him as saying. “I have no authority to deal with the port directly. There is a hierarchy and all those who knew should have known their duties to do the necessary.”

BEIRUT COP KILLED IN ANTI-GOVERNMENT CLASHES

The investigation launched in January reportedly centered around the hangar at the port where the material was being kept after it was seized from a Russian-chartered, Moldovan-flagged ship in December 2013.

The probe was initiated after it was discovered that the hangar was unguarded and had a hole in one of its walls, according to Reuters.

Prosecutor General Oweidat, at the conclusion of the investigation, “gave orders immediately” to secure and repair the hangar, another security official told the news agency.

The fire that ended up sparking the explosion was caused by workers who were welding on-site, Reuters reports.

CLICK HERE TO GET THE FOX NEWS APP

“Given that there were fireworks stored in the same hangar, after an hour a big fire was set off by the fireworks and that spread to the material that exploded when the temperature exceeded 210 degrees,” the official said.

“Only because the hangar faces the sea, the impact of the explosion was reduced. Otherwise all of Beirut would have been destroyed,” he added. “The issue is all about negligence, irresponsibility, bad storage and bad judgment.”

Fox News’ Talia Kaplan contributed to this report.