An equipment failure at the National Grid substation in the south end of Wrentham was the cause of a widespread power failure Thursday night, a spokesperson for the utility said.
The failure affected 5,836 homes and businesses in Wrentham, Foxboro, Plainville and Franklin, according to National Grid.
Most of the customers, 3,675, were in Wrentham. That meant most of the town was in the dark as it has 5,286 customers served by the utility.
The failure also knocked out power to 1,081 homes and businesses in Foxboro, 1,021 in Plainville, and 58 in Franklin.
It hit about 7 p.m. Thursday. Power was restored to 1,900 customers in two hours and all customers by 11 p.m., according to the spokesperson.
Wrentham’s public safety building was forced to run on a generator, Police Chief Bill McGrath said.
Police and firefighters in the area, including in Wrentham and Plainville, responded to several alarms sounding from the loss of electricity, and police had to station cruisers at major intersections because traffic signals were out.