A massive blaze at a Scarborough recreation centre has been fully extinguished after 38 hours of active firefighting operations at the scene, officials confirm.

Firefighters were first dispatched to the Agincourt Recreation Centre near Sheppard and Midland avenues at around 4:45 p.m. on Thursday.

The fire was originally called in as a one-alarm event but it quickly escalated and by 7:30 p.m. that night a four-alarm response was needed.

By Friday morning crews were able to get the fire under control but it continued to burn in the roof of the structure and a drone outfitted with a heat-sensing camera had to be brought in to identify hotspots, along with heavy equipment that was used to peel back portions of the roof.

“This morning at about 7:40 a.m. we called loss stopped which basically means we believe the fire to be out and any further damage will basically be nil,” District Chief Scott Harrison told CP24 at the scene on Saturday morning. “The problem is that there may be a hotspot or two still. We have thermal imaging cameras that we will use from the aerials and from the ground to make sure there is no hotspots.”

The bulk of the fire was concentrated in the roof above a swimming pool, forcing crews to battle it from the exterior of the building rather than inside.

The frigid conditions also presented further challenges with several pumper trucks freezing and having to be pulled from service. One aerial unit also became inoperable after becoming encrusted in ice.

While no estimate has been given for the damage from the blaze, Harrison said that it is “fairly extensive.”

He said that right now crews are removing a portion of the building’s HVAC system to allow investigators to access the interior.

Members of the Toronto Fire Services investigative team are on scene as well investigators with the Office of the Ontario Fire Marshal.

Speaking with CP24 at the scene, OFM investigator Christiaan ter Stege said crews are in the initial phase of their investigation, which includes checking the air quality, making sure there is no hazards and examining blueprints.

He says that an exterior investigation will then be done to determine where the fire started.

“Once we can determine the area of origin we can look at potential ignition causes and that is why we have an engineer on site today,” he said. “We want to identify why the fire started the way it did and how it developed and spread throughout the building.”

Speaking later on Saturday, Chief Matthew Pegg said damage to the interior of the building is “remarkably low,” and the arena portion of the building is completely untouched.

Mayor has promised to rebuild centre

City officials have said that the Agincourt Recreation Centre hosts about 400 recreation programs and courses.

Mayor John Tory has said that staff are working to relocate some of those programs.

He has also promised to rebuild the centre, which is covered by an insurance policy with a $5 million deductible.

In a message posted to Twitter on Saturday morning, Tory thanked firefighters for the “incredible resolve” they showed in frigid conditions over the last few days.

“Thank you to @ChiefPeggTFS & our @Toronto_Fire firefighters who battled this difficult blaze at the Agincourt Recreation Centre. Even during extreme conditions, our firefighters showed incredible resolve. Very thankful there were no injuries,” he wrote.