Firefighters have contained vegetation fires that threatened homes along a rail line west of Christchurch.

Emergency services were called to reports of spot fires along the tracks between Aylesbury and Darfield at 4.15pm this afternoon.

Police said the vegetation fire was “believed to have started due to sparks from a train travelling towards Darfield.”

One witness whose house was under threat told 1News that she could hear the fire and that it appeared firefighters were getting the blaze under control.

“I could hear the crackling,” she said.

“The fire stretched to all along to where the cows are.”

The fire has since been contained, but 17 crews and three helicopters remain at the scene to extinguish “multiple hotspots”.

The train line is still shut, but preparations are underway to re-open State Highway 73.

“There are no longer any homes under immediate threat from fire, and there have been no reports of any homes sustaining damage,” a spokesperson said.