A 21-year-old learner driver caught the attention of police when he decided to take his birthday present for a joyride on the railway line at Abbotsford.
The Taieri Gorge train was briefly stopped about 4.30pm yesterday as the birthday boy and two friends parked their car under the rail bridge at North Taieri Rd.
The car's driver had reached the rail line via an unlocked access road.
The car's occupants were lucky, especially as a train was using the line at the time, Senior Constable Andrew Camp said.
The 21-year-old received the car as a birthday gift and, despite being a learner driver, decided to take ''a joyride with two friends'' on the railway line.
He was parked under the rail bridge when police arrived, Snr Const Camp said.
The incident was reported by a member of the public.
KiwiRail, which owns the line, said no infrastructure was damaged by the incident.
KiwiRail could not comment on why the access gate was unlocked, a spokeswoman said.
But the incident was ''taken seriously''.
''All incidents are avoidable if people don't take foolish risks,'' she said.
Dunedin Railways operations manager Grant Craig said the delay to the Taieri Gorge train was minimal.
He declined to comment on the incident as it was up to KiwiRail to ''deal with those idiots''.
Snr Const Camp said it was too early to comment on what, if any, charges might be laid against the driver.