US President Donald Trump has said American military generals have told him that they “seem to feel” the massive explosion that rocked Beirut was a “terrible attack” likely caused by a bomb.

Mr Trump was asked why he called it an attack and not an accident, especially since Lebanese officials say they have not determined the cause of the explosion.

He told reporters at the White House: “It would seem like it, based on the explosion. I met with some of our great generals and they just seem to feel that it was.

“This was not a — some kind of a manufacturing explosion type of an event … They seem to think it was an attack. It was a bomb of some kind, yes.”

Mr Trump offered condolences to the victims and said the United States stands ready to assist Lebanon. “It looks like a terrible attack,” he said.

A Pentagon spokesman declined to comment on the matter on Tuesday night, referring questions back to the White House.

Lebanon Explosion
Scenes of devastation in Lebanon (Bilal Hussein/AP)

The cause of the blast was not immediately known, but initial reports suggested a fire had detonated a warehouse at the port.

Abbas Ibrahim, chief of Lebanese general security, said it might have been caused by highly explosive material that was confiscated from a ship some time ago and stored at the port.

Local television channel LBC said the material was ammonium nitrate.

Witnesses reported seeing a strange, orange cloud like that which appears when toxic nitrogen dioxide gas is released after an explosion involving nitrates.