BEIRUT -- A massive explosion rocked Beirut on Tuesday, flattening much of the city's port, damaging buildings across the capital and sending a giant mushroom cloud into the sky. More than 70 people were killed and 3,000 injured, with bodies buried in the rubble, officials said.

It was not clear what caused the blast, which struck with the force of a 3.5 magnitude earthquake, according to Germany's geosciences centre GFZ, and was heard and felt as far away as Cyprus more than 200 kilometres (180 miles) across the Mediterranean. Lebanon's interior minister said it appeared that a large cache of ammonium nitrate in the port had detonated.

The sudden devastation overwhelmed a country already struggling with both the coronavirus pandemic and a severe economic and financial crisis.

For hours after the explosion, the most destructive in all of Lebanon's troubled history, ambulances rushed in from around the country to carry away the wounded. Hospitals quickly filled beyond capacity, pleading for blood supplies, and generators to keep their lights on.

For blocks around the port, bloodied residents staggered through streets lined with overturned cars and littered with rubble from shattered buildings. Windows and doors were blown out kilometres away, including at the city's only international airport. Army helicopters helped battle fires raging at the port.

Interior Minister Mohammed Fahmi told a local TV station that it appeared the blast was caused by the detonation of more than 2,700 tons of ammonium nitrate that had been stored in a warehouse at the dock ever since it was confiscated from a cargo ship in 2014. Witnesses reported seeing an orange cloud like that which appears when toxic nitrogen dioxide gas is released after an explosion involving nitrates.

Videos showed what appeared to be a fire erupting nearby just before, and local TV stations reported that a fireworks warehouse was involved. The fire appeared to spread to a nearby building, triggering the more massive explosion, sending up a mushroom cloud and generating a shock wave.

Charbel Haj, who works at the port, said the blast started as small explosions like firecrackers. Then, he said, he was thrown off his feet.

The explosion came amid ongoing tensions between Israel and the Hezbollah military group on Lebanon's southern border. Many residents reported hearing planes overhead just before the blast, fueling rumours of an attack, though Israeli military overflights are common.

An Israeli government official said Israel "had nothing to do" with the blast. He spoke on condition of anonymity because he was not authorized to discuss the matter with the news media. Israeli officials usually do not comment on "foreign reports." The Israeli government offered emergency assistance through international intermediaries.

U.S. President Donald Trump said the U.S. "stands ready to assist Lebanon," and U.S. Secretary of State Mike Pompeo extended his "deepest condolences."

"Our team in Beirut has reported to me the extensive damage to a city and a people that I hold dear, an additional challenge in a time of already deep crisis," Pompeo said in a written statement.

The blast was stunning even for a city that has seen a 15-year civil war, suicide bombings, bombardment by Israel and political assassinations.

"It was a real horror show. I haven't seen anything like that since the days of the (civil) war," said Marwan Ramadan, who was about 500 metres (yards) from the port and was knocked off his feet by the force of the explosion.

Health Minister Hassan Hamad said the preliminary toll was more than 70 dead and more than 3,000 wounded. He added that hospitals were barely coping and offers of aid were pouring in from Arab states and friends of Lebanon.

Beirut's governor, Marwan Abboud, broke into tears as he toured the site, exclaiming, "Beirut is a devastated city." Prime Minister Hassan Diab vowed that "those responsible will pay."

At the start of a White House news conference on the coronavirus, Trump said the explosion "looks like a terrible attack." When asked by a reporter if he was confident that it was an attack, Trump said: "I met with some of our great generals and they just seem to feel that it was."

But one of Israel's top bomb experts, Boaz Hayoun, said fireworks could have been a factor setting off the bigger blast. "Before the big explosion ... in the centre of the fire, you can see sparks, you can hear sounds like popcorn and you can hear whistles," said Hayoun, owner of the Tamar Group, which works closely with the Israeli government on safety and certification issues involving explosives. "This is very specific behaviour of fireworks."

Some of those injured lay on the ground at the port, Associated Press staff at the scene said. A civil defence official said there were still bodies inside the port, many under debris.

Several of Beirut's hospitals were damaged in the blast. Outside the St. George University Hospital in Beirut's Achrafieh neighbourhood, people with various injuries arrived in ambulances, in cars and on foot. The explosion had caused major damage inside the building and knocked out the electricity. Dozens of injured were being treated on the spot on the street outside, on stretchers and wheelchairs.

Outside one hospital, Omar Kinno sat on the pavement, holding back tears. Kinno, a Syrian, said one of his sisters was killed when the blast rocked their apartment near the port, and another sister's neck was broken. His injured mother and father were taken to a hospital but he didn't know which, and he was making calls trying to track them down.

"I have no idea what happened to my parents. I am totally lost," he said.

The UN peacekeeping mission in Lebanon, UNIFIL, said one of its ships in the port was damaged and a number of its peacekeepers were injured, some seriously.

Confusion reigned across the city, as people cleared out of damaged homes or tried to locate family. Motorcyclists picked their way through traffic, carrying the injured.

One woman covered in blood from the waist up walked down a trashed street while talking furiously on her phone. On another street, a woman with a bloodied face looked distraught, staggering through traffic with two friends at her side.

"This country is cursed," a young man passing by muttered.

The blast came at a time when Lebanon's economy is facing collapse from the financial crisis and the coronavirus restrictions. Many have lost jobs, while the worth of their savings has evaporated as the currency has plunged in value against the dollar. The result has thrown many into poverty and has put thousands out of their homes.

The explosion also raises concerns about how Lebanon will continue to import nearly all of its vital goods with its main port devastated.

The explosion -- reminiscent of the massive blasts that often erupted during Lebanon's civil war -- happened only three days before a UN-backed tribunal was set to give its verdict in the killing of former Prime Minister Rafik Hariri in a truck bombing more than 15 years ago. That explosion, with a ton of explosives, was felt kilometres away, just as Tuesday's was.

French President Emmanuel Macron said in a tweet that his country was sending aid. Iran, Hezbollah's patron, also said it was ready to help. "Stay strong, Lebanon," its foreign minister, Javad Zarif, said in a tweet.

------

Associated Press reporters Sarah El Deeb in Beirut; Josef Federman in Jerusalem; and Jon Gambrell in Dubai contributed to this report.