A passing train and live power lines hampered efforts to battle a barn fire in Pitt Meadows early Tuesday morning, but crews were still able to douse the flames before they spread to a nearby home.

The blaze broke out at a rural property on Kennedy Road just before 3 a.m., engulfing a barn and a car that was parked close by.

Unfortunately, firefighters were briefly delayed reaching the scene after they became trapped behind a passing train at a railway crossing. Fire Chief Don Jolley said power lines beside the barn also presented a challenge for crews.

"We had to fight it from a distance until we were sure hydro had the power out," Jolley said.

But they still managed to extinguish the blaze within about half an hour, and all the residents living at a home on the property escaped unharmed.

There were also no animals in the barn when it caught fire, Jolley said.

The cause of the blaze hasn't been confirmed, but early indications are that it was accidental.

"There's some evidence to suggest it may have been electrical," Jolley told CTV News.

Witnesses reported hearing a loud popping sound, almost like gunshots, during the fire. Crews said that could have been a number of things, but was likely the car's tires bursting.

"It's quite a loud bang and there can be three or four of them as the tires go," Jolley said.

The barn and car were destroyed by the flames, and a few trees on the property were scorched as well.

Jolley said the people living at the home were renters, and that authorities would be speaking with the owners after they finish investigating the scene.

With files from CTV Vancouver's Nafeesa Karim