A police bomb squad detonated a possible pipe bomb that was found inside a Brampton church after an object was tossed through a window and a fire broke out early Tuesday morning.

Members of the Peel Regional Police explosive disposal unit were called in to inspect a possible incendiary device after the fire broke out at St. Jerome's Roman Catholic Church, less than an hour after a row of unfinished townhouses burned.

As a precaution, officers did not enter the church. Instead, they used a robot to recover the device and place it inside an explosive containment trailer. The device was taken to a gravel pit, where it was detonated.

Police were unsure if the device was live when it was discovered or if it was a fake. Officers planned to analyze the device after detonating it to learn more about it.

Firefighters found the object inside the building, at 8530 Chinguacousy Rd., when they responded to an alarm at about 3:45 a.m.

It's believed the object was tossed through a window, sparking a blaze that was extinguished by the building's sprinkler system.

For their safety, fire crews were immediately pulled from the building and a bomb squad was called in to inspect the object.

Link to townhouse complex fire?

Police are investigating whether the fire is linked to a suspicious blaze that destroyed at least three townhouse units less than an hour earlier.

The earlier fire occurred at a complex that was under construction on Olivia Marie Road, near Mississauga Road and Steeles Avenue. That blaze was reported at about 3 a.m.

Meanwhile, firefighters in southern Ontario were kept hopping overnight as they extinguished early-morning blazes that damaged or destroyed several buildings.

No injuries were reported in any of the fires, but property damage is estimated in the hundreds of thousands of dollars.

One of the costliest fires occurred on Stonehenge Drive in Ancaster, where seven townhouses caught fire at about 3 a.m., Hamilton fire officials told CP24.

Everyone got out safely.

A fire department spokesperson said the roofs of the townhouses were on fire, but firefighters eventually got the upper hand and extinguished the flames.

In Toronto, fire crews put out an electrical fire at the Bull & Firkin on Yonge Street, near Merton Street, shortly before 3 a.m., police told CP24.

Yonge Street was closed for several hours.

Firefighters also put out a grease fire at a fast-food restaurant at Queen Street East and Church Street.

With files from CP24's Cam Woolley

@ChrisKitching is on Twitter. Don't forget, for instant breaking news, follow @CP24 on Twitter.