The blast, which erupted in an area full of oil and gas fields on Sunday, was caused by a mud volcano, the government says.
None of the oil farms were damaged and no-one was hurt, it added.
Mud volcanoes are formed underground by water, minerals and flammable gasses, which can ignite when they erupt.
Videos shared online showed a fireball and smoke rising above the sea on Sunday.
The blast took place about 10km (6 miles) from the Umid gas field, which is 75km (45 miles) off the coast of Azerbaijan’s capital Baku, state oil company Socar spokesman Ibrahim Ahmadoc said.
It said the fire had been caused by a mud volcano, which spews both mud and flammable gases.
Mud volcanoes are similar to normal volcanoes but without lava. They are caused by water being heated deep within the Earth that mixes with rocks and minerals – when they erupt, this mixture is forced to the surface and can catch fire.
About 400 of the world’s estimated 1,000 mud volcanoes are in Azerbaijan.
Nicknamed the “Land of Fire”, Azerbaijan is famed for its its rich oil and natural gas reserves. Explorer Marco Polo wrote about the fires in the 13th Century.
“The mud volcanoes in Azerbaijan are some of the biggest and most violent in the world. There are, on average, several large mud volcano eruptions each year, and many of them can have big fires,” Dr Mark Tingay, a geophysicist at the University of Adelaide, wrote on Twitter.
The explosion follows a fire on the ocean surface in the Gulf of Mexico, which was extinguished on Friday after burning for more than five hours.
The blaze was blamed on a gas leak from an underwater pipeline.