Two firefighters narrowly escaped injury when the ceiling in a burning McDonald's restaurant collapsed and missed them by 3 feet Monday morning.

The firefighters were in the doorway of the restaurant, 1879 E. 4800 South, when a wooden structure in the burning ceiling came crashing down behind them, covering the ordering area and counter, said Salt Lake County Fire Lt. Dennis Steadman.Employees arrived at 5 a.m. Monday and had been inside the restaurant for some time before discovering the fire, which was reported at 5:51 a.m., Steadman said.

An automatic fire extinguisher over the deep fryer went off, but it wasn't until the lights started to flicker and an employee checked and saw smoke coming from behind an electrical panel that the workers knew there was a fire and evacuated the restaurant. They went to the convenience store next door where the clerk had already called the fire department after noticing smoke coming from the roof of the restaurant, Steadman said.

Flames never spread below the ceiling, but the restaurant sustained "very extensive damage" when the ceiling section collapsed, Steadman said.

Investigators determined later Monday morning that an electrical problem between the ceiling and the roof started the fire. A dollar amount of the loss was not available, but Steadman said damage to steel beams will require the entire roof to be replaced.