Workers tend to a train that derailed at Masterton Station in the Wairarapa.

A train has derailed on the rail line between Wellington and Masterton, and is expected to affect commuter services through to Monday.

Commuters waiting for train services from Masterton were left with bus replacements on Sunday afternoon after the train derailed in the yard near Masterton railway station.

Were you on the train? Email us at newstips@stuff.co.nz

STUFF Commuter services on the Wairarapa train line between Masterton and Wellington are expected to be out of commission until Monday because of the incident.

Metlink warned travellers that the 6.55pm service from Wellington to Masterton would be replaced with buses after what it called an "operational incident" just after 4pm. The replacements will be for passengers intending to travel from the Masterton and Solway stations. Trains will run between Renall St and Wellington stations.

READ MORE:

* No knees please: Wellington bus drivers banned from wearing shorts

* Metlink admits several teething problems following rollout of new Wellington bus network

* Metlink advises commuters to download most accurate clock in the world to ensure they don't miss their train

A Metlink spokeswoman said services would still be out on Monday morning and would be replaced by bus services.

A commuter who was waiting for a train at the Masterton station said there was an "almighty thud" as the locomotive derailed at the southern end of the railway yard.

The derailed train was visible from the station, they said.

In an emailed statement, Metlink said the derailment happened while a passenger service was travelling to Masterton station to collect passengers. The locomotive and a carriage derailed, but no passengers were on the train at the time, the statement said.

The cause of the derailment was unknown.

Metlink said re-railing the train "may take time" as a crane was needed to lift the locomotive and carriage back onto the tracks. "We hope to have them back in action before the afternoon peak, and will send out updates when we can run trains to and from Masterton station again."

"We sincerely apologise for the inconvenience."

KiwiRail acting chief operations officer Henare Clarke apologised to commuters.

The 5.46am, 6.20am, 6.47am and 10.30am services will be replaced by bus between Masterton and Solway stations. Trains will run between the Renall St station and Wellington station. Passengers from Masterton station will need to travel by bus to Solway Station to meet the train.

The 8:21am service from Wellington to Masterton will run to Renall St. Passengers who need to travel to Masterton can take a shuttle bus from Solway Station.

Transport Accident Investigation Commission (TAIC) spokesman Simon Pleasants said the commissioner was aware of the incident and was waiting on further information.

Most train services were replaced by buses between December 24 and January 6 for the Kāpiti, Hutt Valley, Melling and Wairarapa lines while track work was carried out between Wellington and Upper Hutt. The services were expected to resume after January 6, with regular weekday services expected to begin on Monday.

The "essential maintenance work" meant buses had replaced the trains on January 3 and 4 on the Hutt Valley, Wairarapa and Kāpiti lines.