The Polish navy said the bomb was found last year during preparatory work to deepen a waterway leading to the port of Szczecin in the northwestern part of the country.
As officials dealt with the bomb, more than 750 people were evacuated from outside the town of Świnoujście.
Polish navy demolition experts tried to neutralize it under water through remote deflagration, which means burning out its explosives, but it went off in the process.
“The deflagration process turned into detonation. The object can be considered as neutralized, it will not pose any more threat,” 2nd Lt. Grzegorz Lewandowski, the spokesman of the 8th Coastal Defense Flotilla, told the state-run news agency PAP. “All mine divers were outside the danger zone.”
The blast from the bomb that weighed nearly 5,400 kg, including 2,400 kg of explosives, was felt locally in Swinoujscie.
Swinoujscie has a liquefied natural gas (LNG) terminal but a spokesman for the town’s mayor said no injuries were reported and no infrastructure was damaged, according to Reuters.
The navy said the operation took "safety measures" into account, including the possibility of the bomb exploding.
"The method used, first of all, did not pose any risk to soldiers and people directly involved in the operation," the Polish navy said.
The Tallboy bomb was designed by British aeronautical engineer Barnes Wallis and was used by the Royal Air Force to destroy large Nazi-controlled assets through underground shocks.
The Associated Press contributed to this report.