WALDWICK, N.J. (CBSNewYork/AP) — Hundreds of utility customers in Bergen County lost power Sunday after an equipment failure at a substation sparked flames and sent thick, black smoke shooting skyward.

It wasn’t immediately clear what caused the issue at the substation in Waldwick, which was reported around 10:40 a.m.

READ MORE: New York Weather: CBS2’s 11/28 Sunday Morning Forecast

Residents said they heard an explosion and felt some shaking.

“It was like an explosion, a big ‘bang bang,’ the house shook. It was crazy,” Phil told WCBS 880’s Jim Smith.

Phil said that’s when he saw the flames and a huge cloud of black smoke.

“And it was just billowing all the way up,” he said.

“All of the sudden you hear like shots, and I was scared,” one resident told CBS2’s Tracee Carrasco.

About 40 homes in the area were evacuated as a precaution, 1010 WINS’ Carol D’Auria reported. Other residents were advised to keep their windows closed.

“Within minutes they said ‘no, get everybody and have them start evacuating. We don’t know exactly what it is,'” said one resident.

Firefighters from all around the area rushed in to help, battling the flames for hours by spraying foam on it until it was extinguished around 7:15 p.m.

One firefighter suffered a minor injury while battling the blaze, D’Auria reported.

READ MORE: Alec Burks, Evan Fournier Spark Knicks Past Hawks

A large plume of black smoke is seen in Waldwick, N.J., during a fire at a PSE&G substation on Sept. 13, 2015. (Credit: @cmchugh11/Twitter)

A large plume of black smoke is seen in Waldwick, N.J., during a fire at a PSE&G substation on Sept. 13, 2015. (Credit: @cmchugh11/Twitter)

Officials said about 2,000 customers lost power, but service was fully restored about three hours later.

Jim O’Connell, coordinator for the Office of Emergency Management, said the substation is a high-voltage facility, and so firefighters couldn’t enter until half of the plant was de-energized, which took about two hours.

“If we were to enter it would be a risk to us. So our standard procedure is to wait on the outside until Public Service gives us the go-ahead,” said O’Connell.

“The transformer is covered in oil inside to keep it cool, so they just have to burn all the oil off. You can’t be throwing water on it because electricity is there,” said Waldwick resident Ralph Eichinger.

The fire burned hundreds of thousands of gallons of mineral oil, but it is not considered toxic because there are no PCBs, D’Auria reported.

“The fire never at any time was toxic to the residents of the community,” said Mayor Tom Giordano said.

A utility spokeswoman said the incident was under investigation, and Waldwick police declined comment.

The plant is near a NJ TRANSIT train line. Some trains were delayed by as much as 35 minutes.

MORE NEWS: Suns Extend Win Streak To 16 With Victory Over Nets

(TM and © Copyright 2015 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2015 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)