Dylan Tattersall, 28, committed the offences in Accrington in the early hour of June 19, last year, when he threatened the victim while holding a metal bar before twice attempting to carry out serious sexual assaults on her.
The victim managed to secretly take photographs of Tattersall on her phone in order to raise the alarm.
Tattersall, of Gloucester Avenue, Accrington, was arrested later the same day.
Following consultation with the Crown Prosecution Service, he was charged with two rapes and a number of breaches of a non-molestation order.
During a trial in December 2022, a jury found Tattersall guilty of breaching the non-molestation order but were unable to reach a verdict in relation to the charges of rape. Tattersall later pleaded guilty to two alternative counts of attempted rapes, with the victim ready to give evidence for a second time. He was today sentenced for those offences and breaches of the non-molestation order he had previously pleaded guilty to.
Sitting at Preston Crown Court, Judge Heather Lloyd deemed Tattersall to be a dangerous offender and sentenced him a three-year extended licence period.
Tattersall was also ordered to sign the Sex Offenders Register for life. A Restraining Order was also put in place.