"This is a sentence of last resort and the decision is not taken lightly."

O'Leary was told he must serve a minimum of seven years in prison but was warned he is likely to spend much longer in custody.

He will only be released when the parole board considers it safe to do so.

After the case, Detective Inspector Phil Jackson, of Leeds District CID, said: "O'Leary held the victim captive and put her through an absolutely terrifying ordeal over a prolonged period during which she genuinely feared he was going to kill her.

"A detailed and comprehensive investigation showed O'Leary had spent a number of hours in the city centre looking for a victim to target. He has previously been convicted of a similar offence and he is clearly a dangerous individual with a predatory nature.

"We hope the significant sentence he has received will provide some degree of comfort to the victim and will also serve as reassurance to the wider community."