There is never a good time for an oil refinery explosion, but Friday morning’s Philadelphia Energy Solutions fire came about as close as you can get.

The city’s Office of Emergency Management and Fire Department were fresh off a discussion at the Navy Yard, where various agencies met Thursday to plan an inter-agency response to a specific hazardous emergency. The officials discussed each agency’s planned response and protocol to make sure everyone was on the same page, said Noëlle Foizen, deputy director for public engagement for the Office of Emergency Management.

While the training wasn’t specifically about responding to a refinery emergency, it’s reflective of the type of training city officials are constantly undertaking to better work with one another in emergency situations.

Less than 24 hours later, Foizen’s office, along with the Fire Department and several other agencies, leaped into action in response to the fire that closed streets and the George C. Platt Memorial Bridge, and had residents sheltering in place for several hours.

“Immediately when arriving, companies saw the magnitude of what they had, and issued a second alarm and then third alarm,” said Deputy Fire Commissioner Craig Murphy. “And that was the initial response.”

>> READ MORE: Gasoline futures increase after South Philadelphia refinery fire; prices may go up at pump

The Fire Department activated its fire boat, hazmat unit, and other specialized trucks to support the Philadelphia Energy Solutions fire brigade. Murphy said the Coast Guard and FBI also assisted.

The refinery, which has its own water supply separate from the city water system, started running into water-pressure issues and called for the Fire Department’s help pumping in water, Murphy said.

“We were able to supplement them. We had our fire boat that connected to the bulkhead ... inside the refinery,” Murphy said. The fire boat pumped water from the river and delivered it with enough pressure to help with battling the fire.

Although various fire trucks had hoses connected to city water lines, ready to supplement more water, Murphy said there ended up not being a need for that.

“The biggest piece for us is staging our folks in case we are called to the ready,” he said. “We’re just standing by, and it’s just managing.”

Murphy said responses to such incidents have a unified command and everyone has their roles and responsibilities. It’s all coordinated during training exercises, so when agencies respond during a real emergency, everyone is “actually talking the same language,” Murphy said.

>> READ MORE: Officials say air tests from South Philly refinery fire show no immediate cause for alarm

“Our coordinated relationship with Philadelphia Energy Solutions was right on point for this,” Murphy said. “It worked out exactly how it should have, how we trained for.”

Planned responses have changed over the years and will continue to be tweaked.

A lot of changes came after the 1975 refinery fire that killed eight firefighters, including: fire-suppression systems above and below ground; diking between various sections of refineries; and the presence of company firefighting teams at the facilities.

Murphy said that it will take some time to determine what to improve or do differently based on Friday’s response. “An after-action [report] will be developed for this event and we’ll look at that,” he said.

Staff writer Joseph A. Gambardello contributed to this article.