DAKAR, Senegal — Roughly 100 people have died after an explosion sent flames coursing through a gas station in the center of Accra, the Ghanaian capital, officials said on Thursday.

The explosion occurred Wednesday night while the station was packed with residents seeking shelter from knee-high water caused by days of torrential rain that flooded much of the city, officials said.

By Thursday morning, 108 bodies had been counted, Mayor Alfred Oko Vanderpuije of Accra said in a telephone interview from the capital.

“The area looked like a fire disaster zone. Everything has been burnt down,” said Mr. Vanderpuije, who added that he had visited the scene Thursday morning with Ghana’s president, John Dramani Mahama. “All the vehicles in the filling station have been burned. We saw bodies there. It’s a major disaster.”

One witness said that a bus packed with passengers parked at the station had caught fire and all on board had died.

Francis Boateng, a Red Cross official in Accra, said that the rain began three days ago and that water had flooded the gas station’s fuel storage. “The fire was on the water,” he said. “There are so many people who were consumed by the fire.”

Image Ghana President John Dramani Mahama Credit... Stephanie Lecocq/European Pressphoto Agency

Mr. Boateng put the death toll at around 90 and said the search for bodies was continuing in the high waters.

Ghanaian news outlets reported that the flooding had impeded rescue workers, and that ambulances had been late to arrive at the scene. Early Thursday morning, two vans packed with charred bodies left for the morgue, but a military hospital reported that the morgue was at capacity and could not take any more of the dead.

Touring the disaster scene, Mr. Mahama said, “The loss of lives is catastrophic and almost unprecedented.”

He was critical of the disorderly approach to construction in the capital, which exacerbates flooding during periods of heavy rain.

“We should not continue to be like the vulture who says he would roof his house when the rain comes,” Mr. Mahama said.

Flooding has battered the already shaky power infrastructure in the capital, where the electricity deficit has brought thousands of demonstrators into the streets this year and hurt the country’s economy.

Ghana’s currency has dropped precipitously against the dollar over the past year, and the country was forced to seek a three-year loan of more than $900 million from the International Monetary Fund, even as the fund was critical of the government’s undisciplined public spending.