About 5,700 customers in Ware and Hardwick lost power temporarily Saturday, after a control panel running a powerful circuit breaker at a substation failed, according to National Grid spokesman David Graves.

The outage occurred at 11:20 a.m. Saturday, affecting 5,700 customers, Graves said in a telephone interview. Crews restored power to 4,200 residents by 1:20 p.m. and the rest by 2:30 p.m., he said. Baystate Mary Lane Hospital was one of the customers, but was protected by a generator.

When the control panel failed, two primary power lines from the substation lost power.

The substation is at Gilbertville Road, according to a utility worker.