An electrician discovered a Massachusetts house was rigged to explode with the flip of a switch during an inspection, police said Tuesday.

The property owner was having the uninhabited Milton house prepared for sale when the electrician came across the deadly booby-trap inside a bedroom closet, WCVB reported.  

It took several hours for a team of Boston police bomb experts to disarm the devise- a container filled with a type of inflammatory substance, connected to a series of wires that weaved throughout the house and ultimately led to a light switch, according to NBC News.

Police said the device was meticulous in its construction and could have caused a catastrophe.

"We believe the intention was that if someone flipped the light switch on where it ended, the device would have exploded," Milton Police Chief Richard G. Wells Jr. told NBC News.

"Clearly, by what we believe was the intent of the design of this device, it was definitely intended to do some significant destruction."

The house in question was the subject of a vandalism Milton police responded to last week. Responding officers noted the drains inside the house, which was occupied with tenants at the time, were plugged with cement.

Property owner Lendel Williams said the people renting the Craig Street home moved out on Sunday, WCVB reported.  

Police from the Milton and Boston departments are now working to track down the previous tenants as potential suspects.