A German tourist's New Zealand trip went off the rails, and then on to them, when his homesick girlfriend left him.
Marcel Mauch, 25, found himself under the influence behind the wheel with his car stuck on Napier railway lines in the early hours of March 3.
Mauch pleaded guilty before Judge Geoff Rea in the Napier District Court on Wednesday to a charge of driving with excess blood alcohol content.
Lonely and distraught after his girlfriend went back to Germany, Mauch took to the bottle to drown his sorrows.
He then drove south along Hyderabad Rd, but crashed off the road and got his car stuck on the railway tracks which ran parallel to the road.
A blood alcohol reading taken by police showed he had 172 milligrams of alcohol per 100ml of blood, three times the legal limit.
Defence counsel Cam Robertson told Judge Rea that Mauch was remorseful and was prepared to face the consequences of his actions.
"He doesn't usually drink, but on this occasion he was upset and lonely," Robertson said.
Mauch, a qualified mechanic, also lost his job as a result of the incident and had plans to return to Germany - but his travel fund would be significantly affected by police fines, court costs and a hefty bill from KiwiRail.
He was ordered to pay $1132.86 in reparation to KiwiRail as well as $600 in fines and $111 in analyst fees.
KiwiRail acting chief operations officer Henare Clarke said there were reasons for the significant reparation cost.
"In this case, as with all our recoveries KiwiRail is simply recouping the costs incurred by our organisation.
"That includes the cost of train control, an incident co-ordinator, a track worker to carry out an inspection to check for damage , an after-hours fee, mileage and the cost to the business of closing the line.
"Incidents like these highlight the need for people to take extreme care around level crossings."