A man caused over £1m worth of disruption to Yorkshire's transport network by threatening to throw himself off a gantry at Leeds railway station.
Peter Myers was jailed for six months today after a court heard how his actions caused chaos for rail users on May 30 this year.
Services were disrupted throughout most of the day after 319 trains had to be cancelled.
A further 169 services were part-cancelled, with the total number of delays put at 171 hours.
Leeds Crown Court heard Myers' actions were estimated to have cost the transport industry £1,069,000.
Dave Mackay, prosecuting, said Myers gained access to a gantry above platform eight at Leeds station at 7am.
He dangled his legs over live electric cables and threatened to jump on to the tracks below.
Operators had to isolate the lines and British Transport Police officers evacuated the area.
Myers also threw his passport on the tracks and refused to get down when officers tried to speak to him.
The prosecutor said one officer managed to build up a rapport with Myers but he still refused to come down and threw his mobile phone on to the tracks.
The defendant ordered the officer to take off his hi-vis vest.
Trained negotiators were called to the scene and Myers eventually agreed to come down at 9.30am.
He was then taken to the Becklin Centre in Leeds but not assessed as suffering from mental health problems.
Myers was then interviewed about the incident.
Mr Mackay said: "He said he was struggling in relation to his ex-partner and he too felt like a victim."
The defendant refused to comment further when he was taken to a police station.
Myers, of no fixed address, pleaded guilty to obstructing an engine or carriageway by using the railway for an unlawful act.
The offence is charged under the Malicious Damage Act 1861 and carries a maximum sentence of two years.
The court heard Myers has 30 previous convictions for 51 offences dating back to when he was aged 11.
He was jailed for two years in 2017 for false imprisonment after he barricaded himself in a house with two children.
He also has convictions for arson, robbery and being drunk and disorderly.
Richard Reed, mitigating, said Myers, also known as Peter Michael Donoghue, had pleaded guilty to the offence at an early stage.
He said: "He was on the gantry contemplating taking his own life and in his desperate state he gave no thought at all of the chaos and inconvenience of what might follow in his actions.
"He is profoundly sorry for all the inconvenience he has caused to those people.
"This wasn't a deliberate act on his part to cause disruption."
Jailing Myers, judge Colin Burn said: "It was a deliberate act that you had taken to put yourself in that position.
"I accept that you did not intend to hurt anybody but that could have been the outcome of this.
"I do not just mean to yourself, but to those who felt it your duty to try and rescue you from this position.
"British Transport Police would not have known what was going through your mind or what your ultimate intentions were.
"You behaved without any regard to the enormous inconvenience to thousands, if not tens of thousands of people who were using the rail system at the time."