A Brooklyn mosque was destroyed in a fire early Saturday, officials said.

The blaze broke out just before 6 a.m. inside the Brooklyn Broadway Islamic Center, on the second floor of a Gates Avenue building in Bedford-Stuyvesant.

“We saw a very rapid eruption,” said building owner Gulzar Hossain. “The whole mosque is damaged. They had to cut off the roof.”

It took more than 90 minutes to get the two-alarm fire under control. No one was injured.