The jail already had two feet of water in the basement from the record-setting rains when an apparent gas explosion leveled the inside of the building, killing two inmates and injuring more than 180 people, officials said Thursday.

In the rubble and chaos, inmates were trapped and had to be rescued. Others were treated for their injuries in the parking lot. In all, 600 inmates rushed out of the jail. The injured were taken by bus to hospitals, while the others were sent to nearby jails.

Authorities lost track of three inmates in the confusion, but by late afternoon, they were confident everyone was accounted for. The names of the inmates killed weren’t immediately released.

Investigators said it could take days to determine what caused the explosion. They were having a hard time getting to the epicenter in the back of the building because there was so much damage.

Joseph Steadman, the head of the state fire and arson bureau, described it as a “collapse of concrete floors between the basement and upper floors.”

He said it was still too early to say if the weather had anything to do with it.

Richard Long, a Colorado-based engineer who owns a construction consulting firm, said flooding could cause a gas leak by moving pipes around. The flooding occurred in the jail’s basement, where the kitchen and laundry are. No inmates were housed there, officials said.

More than 15 inches of rain fell on Pensacola on Tuesday, the rainiest single day since forecasters started keeping records in 1880. Neighborhoods were flooded and hundreds of people had to be rescued from homes and cars.

County spokesman Bill Pearson said 184 people were taken to hospitals, and only two inmates and one corrections officer were still there Thursday afternoon. He wouldn’t describe the extent of their injuries, citing privacy laws.

One female inmate went into labor during the explosion and later had a healthy baby, county spokeswoman Kathleen Castro said.

About 200 men and 400 women were in the building. Barnes said during the evacuation, hundreds of inmates and corrections officers had to use one stairwell, “everyone pushing and bleeding.”

“Every inmate is accounted for,” said Lumon May, chairman of the Escambia County board of commissioners. “Most important to us was the lives and safety of our inmates.”

After the blast, a group of relatives and attorneys for the inmates stood behind police tape that cordoned off the area, trying to figure out where loved ones had been taken. Many family members were upset because they said they were left in the dark.

Defense attorney Gene Mitchell was reviewing dozens of text messages from clients’ relatives.

“I have over 20 clients in there,” he said. “I’ve had dozens of calls. Every other call is a family member wanting to know what has happened to a loved one.”

He said he hasn’t been able to get much information about the inmates. Castro said officials were having trouble notifying families because for hours it wasn’t safe to enter the jail to access computers and paper records. Later, officials promised better updates for families on the county’s website.