Power has been restored after a massive fire at a lumber yard in Pembroke left most of the city in the cold and dark overnight.

The fire burned into the night at the former International Lumber building, now owned by Lavern Heideman and Sons. Flames broke out at the building on Boundary Rd. between 8:00 and 8:30 p.m. Wednesday.

A major hydro supply line from Hydro One was taken out in the fire and was to blame for the power being out to most of the city.

"The hopper collapsed putting live wires down, which put all of Pembroke out of power," said Pembroke Fire Captain Gary Lowe.

"This is one of the largest, most challenging fires I've ever been a part of."

"It didn't matter where you were coming from within the city, this is what you could spot," said Pembroke Mayor Michael LeMay.

"It was one big great orange flame."

BREAKING: fire continues to burn at International Lumber on Boundary Rd. in Pembroke. I’m told there’s a hydro feeder line along here and that’s likely why power is out across Pembroke. pic.twitter.com/XefmhZ4Mpp — Tony Grace (@tonygracectv) January 3, 2019

A major structure fire has damaged the Hydro One supply line coming into Pembroke. Crews are dispatched and awaiting safe entry to the property to begin repairs. There is currently no ETR at this time. — Ottawa River Power (@ORPowerCorp) January 3, 2019

Pembroke Fire Chief Daniel Herback says a portion of the building collapsed onto a transformer, which is what caused the large-scale power outage.

Ottawa River Power Corp. says power wasn't expected to be back on until approximately 10:00 a.m. Thursday. Many residents lost power when the fire started.

Outage Update (Pembroke): Crews are about to begin repairs on the line outside of the active fire zone. Additional repairs are required in the area that is currently still considered unsafe. ETR is approximately 8-10hrs. @Star96FM @1049myFM @PembrokeInfo — Ottawa River Power (@ORPowerCorp) January 3, 2019

However, the power company gave an update at around 6:30 a.m. saying that overnight crews were able to switch everyone back on a few hours ahead of schedule.

"We are looking at all options to ensure that our employees continue to work and that our customers needs are met," said Kris Heideman of Lavern Heideman and Sons in a statement to CTV News.

The company employs 26 people at their Pembroke mill.

"The people of the Ottawa Valley are well-known for moving ahead," said LeMay.

"We'll get there, we'll get back on top."

The cause of the fire remains unknown. Firefighters remained on scene into the afternoon Thursday to take care of hot spots.

No one was hurt. The Ontario Fire Marshal is investigating.