Experts have recovered the data recorder of a fire-ravaged ship carrying chemicals that is slowly sinking off Sri Lanka's coast, as salvage crews stood by to head off a possible environmental disaster.

The Singapore-flagged MV X-Press Pearl started sinking on Wednesday, a day after authorities extinguished a fire that raged on the vessel for 12 days.

Efforts to tow the ship into deeper waters away from the port in the capital Colombo had failed after the vessel's stern became submerged and rested on the seabed.

Sri Lanka Ports Authority said experts, together with the navy, have recovered the ship's voyage data recorder, or VDR, commonly known as the black box.

The authority said on its website that the VDR, which contains vital information related to the operation of the vessel, would be handed over to local law enforcement agencies investigating the fire.

Both the authority and the ship's operator said the vessel's aft portion remains on the seabed at a depth of about 70 feet, and the forward section continues to settle down slowly.

Operator X-Press Feeders said crews remain on the scene to deal with any possible spills. It has apologised for the disaster.

The port authority and the operator said there were no signs of oil or chemical spills. They said that Sri Lanka's navy, the Indian coast guard, salvage crews and local authorities were capable of responding to any signs of oil pollution or debris, and were monitoring the situation around the clock.

The fire has destroyed most of the ship's cargo, which included 25 tons of nitric acid and other chemicals. But there are fears that the remaining chemicals as well as hundreds of tons of oil from the fuel tanks could leak into the sea.

Such a disaster could devastate marine life and further pollute the island nation's beaches. The disaster has already caused debris - including several tons of plastic pellets used to make plastic bags - to wash ashore.

The government has banned fishing along about 50 miles of coastline.

Officials say there had been about 300 tons of oil on board and that experts believe it could have burned off in the fire.

Environmentalist have warned that there is the potential for "a terrible environmental disaster" as hazardous goods, plastics, chemicals and oil could be released into the water and destroy marine ecological systems.