Bangladeshi rescue workers searched for more bodies on Sunday after righting an overloaded ferry that capsized in an accident that claimed at least 51 lives.

Local police chief Zakir Hossain told AFP that 18 victims were retrieved from the lower deck and cabins that were locked when the crowded MV Coco-4 ferry overturned late on Friday.

A special salvage vessel turned the boat back onto its hull, and Hossain said rescuers expected to find further bodies inside.

"We have so far 51 dead, including 20 children. Today, most of the bodies were recovered from locked cabins and the lower deck," he said.

Distraught relatives of missing passengers gathered on the banks of the river Tentulia in the remote southern village of Nazirpur as the partially sunk boat was righted.

Officials said they were uncertain about how many people were on board as there was no passenger list.

"We have almost completed the rescue work. The toll will increase, but not substantially," district administrator Mejbahul Islam said.

The triple-decked ferry, which had a capacity of 665, was packed with more than 1000 passengers and began taking in water when it came into dock, Hossain said.

Most passengers managed to swim ashore or were rescued by divers who prised open some cabins of the submerged vessel.

Passengers, who were returning to their villages from the capital Dhaka for the three-day Islamic festival of Eid al-Adha, recounted terrifying scenes as the vessel started to list.

"There was no empty space in the ship. Every inch was filled with passengers," Mohammad Ripon, 30, told reporters on Saturday.

"People were running helter-skelter in panic. Then the ship tilted to the left side and I just jumped into the river," he said.

Amir Hossain, whose brother and nephew were among the missing, said: "Everyone had come back to the village to celebrate Eid. Last night, as we waited for our eldest brother, we heard on the radio the Coco had sunk.

"Our Eid is over," he said.

The accident occurred on Friday around midnight as the MV Coco-4, one of the country's largest inland vessels, was approaching the dock on Bhola island.

Shipping Minister Shahjahan Khan told AFP that an investigation had been launched.

"Our initial finding was that the ferry was heavily overloaded. Officials had locked the ferry's exit gate as it approached the shore to find out whether anyone was travelling without a ticket," he said.

"This triggered a stampede, causing the boat to tip," Khan said, adding the vessel also had a "history" of problems.

Boat and ferry accidents due to lax safety standards and overloading are common in Bangladesh, which is criss-crossed by 230 rivers.

It is estimated that more than 3000 people have lost their lives in such accidents since 1977.

Ahead of every festival, Bangladeshi authorities warn shipowners not to overload ferries, but owners regularly ignore the warnings.