Shipyard workers have captured the moment a ship suffered a huge explosion in Indonesia.

Indonesian authorities said the incident took place on Thursday afternoon at the Barokah Perkasa yard in the Mahakam River at Samarinda.

Footage apparently filmed on a phone by a yard worker shows black smoke billowing from the ship before a massive explosion rocks the vessel, resulting in a plume of fire shooting skywards.

The phone is dropped before subsequent footage shows a co-worker putting on a hard hat and running for cover as prayers are offered.

Hoses are later shown being trained on the vessel.

The ship involved was named by Indonesian media as the 2,010-cbm LPG carrier Grace V (built 1989), but the video appears to show the blast occurring on a small bunker tanker berthed at the stern of that vessel.

Several explosions heard

The LPG carrier is operated by Bahari Nusantara, which has been contacted for further information.

Local resident Hermawan told the Antara news agency that he heard several explosions.

"During the first explosion, I thought the gas cylinder exploded. But then another explosion occurred, and I saw many residents looking at the shipyard," he said.

He added a number of objects were seen flying into the air.

The head of Samarinda Police, Iwan Pamudi, told Antara conditions on board the affected ship were now safe.

He added the cause of the accident was not yet known.

Police have begun investigations at the site.