It revived memories of a 1975-90 civil war and its aftermath when Lebanese endured heavy shelling, car bombings and Israeli air raids. Some residents thought an earthquake had struck.
Dazed, weeping, and injured people walked through streets searching for relatives.
"The blast blew me meters away. I was in a daze and was all covered in blood. It brought back the vision of another explosion I witnessed against the US embassy in 1983," said Huda Baroudi, a Beirut designer.
Prime Minister Hassan Diab promised there would be accountability for the blast at the "dangerous warehouse", adding "those responsible will pay the price".
The US embassy in Beirut warned residents about reports of toxic gases released by the blast, urging people to stay indoors and wear masks.
Many missing
"There are many people missing. People are asking the emergency department about their loved ones and it is difficult to search at night because there is no electricity," Health Minister Hamad Hasan told Reuters late on Tuesday.
Footage of the explosion posted on social media showed a column of smoke rising from the port, followed by an enormous blast, sending a white cloud and a fireball into the sky.
Those filming the incident from high buildings 2 km (one mile) from the port were thrown backwards by the shock.
Bleeding people were seen running and shouting for help in clouds of smoke and dust in streets littered with damaged buildings, flying debris, and wrecked cars and furniture.
The explosion came three days before a UN-backed court is due to deliver a verdict in the trial of four suspects from the Shi'ite Muslim group Hezbollah over a 2005 bombing that killed former Prime Minister Rafik al-Hariri and 21 others.
Hariri was killed by a huge truck bomb on the same waterfront, about 2 km (about one mile) from the port.
Officials in Israel, which has fought several wars with Lebanon, said it had nothing to do with the blast and said their country was ready to give humanitarian and medical assistance.
Shi'ite Iran, the main backer of Hezbollah, also offered support, as did Tehran's regional rival Saudi Arabia, a leading Sunni power. Cyprus said it was ready to offer medical aid.
At a White House briefing, US President Donald Trump indicated that the blast was a possible attack, but two US officials said initial information contradicted Trump's view.
(Writers: Dominic Evans, Ghaida Ghantous | Editors: Sonya Hepinstall, Robert Birsel)
Simak breaking news dan berita pilihan kami langsung di ponselmu. Pilih saluran andalanmu akses berita Kompas.com WhatsApp Channel : https://www.whatsapp.com/channel/0029VaFPbedBPzjZrk13HO3D. Pastikan kamu sudah install aplikasi WhatsApp ya.