At least four bodies were on board the Malaysia-bound boat, which was being towed to a Bangladeshi island in rough seas, the official and one of the passengers told AFP.
Bangladeshi coastguard commander Shahidul Islam told AFP that the remaining 300 passengers were safe.
"They told us that there are four dead bodies in the ship. We haven't searched the ship yet. We're bringing it to the Saint Martin's Island," he said.
Islam could not confirm how the four died, but one of the passengers told AFP from aboard the boat that they were fired on as they tried to leave Bangladesh's southern coast near neighbouring Myanmar.
More From This Section
"The Myanmar people fired at us," passenger Ziaur Rahman said by phone without saying if the military was behind the shootings.
"They then fired at us from another ship and five to six people have died. The bodies are in the lower deck," he said.
Another Bangladesh coastguard commander, Harun-or-Rashid, told AFP that the ship's engine broke down after a fight erupted between passengers and members of the crew from Myanmar.
Rahman, from Bangladesh's southernmost town of Teknaf, said he paid a human trafficker about $2,000 for the boat journey to Malaysia and that others paid more.
Bangladesh's coastguard and border forces have launched crackdowns on the economic migrants, confiscating their ships and arresting a number of human traffickers.