More than 300 people including two Thai crew and an alleged people trafficker from Myanmar were on board the Malaysia-bound vessel, which was found seven nautical miles southeast of Bangladesh's southern-most Saint Martin's Island in rough seas, they said.
Thousands of poor Bangladeshi and ethnic Rohingya refugees from Myanmar try to migrate to Malaysia every year on a perilous and sometimes fatal 3,200-kilometre journey.
"We searched the ship and found five bodies of Bangladeshi nationals. All of them were shot dead by the crew and the traffickers," coastguard commander Harun-or-Rashid told AFP by phone from the island close to the Myanmar border.
Once the fighting began, traffickers from other nearby boats began to fire on the ship, Rashid added.
Also Read
"We found 318 people on the ship, which is a big Thai cargo boat.
"At least 23 of the passengers had bullet wounds and were being sent to a hospital. Their condition is not critical," he said.
"Another 151 were also injured or were starved for up to 20 days. Some of them were stabbed by knives during the clash," he said, adding that the ship's engine had broken down after the fighting.
One of the passengers told AFP from aboard the ship that they were fired on as they tried to leave Bangladesh's southern coast, near neighbouring Myanmar.
"They then fired at us from another ship and five to six people have died. The bodies are in the lower deck," passenger Ziaur Rahman said.
Rahman, from Bangladesh's southernmost town of Teknaf, said he paid a human trafficker about USD 2,000 for the boat journey to Malaysia and that others paid more.