A 6ft 10ins tall man tried to rape a woman at knifepoint - before she fought him off and raised the alarm.
Police said they were quickly able to trace Matt Mellor, 40, who had followed the young woman, grabbed her and forced her to the ground before attempting to rape her while threatening her with a knife.
The attack took place when Mellor began following his victim in Wellingborough Road in Northampton at around 1.50am on 26 February. When she got to Lutterworth Road, he grabbed her from behind and dragged her to the ground.
The victim was able to attract attention of people living in the area, forcing Mellor to flee the scene in his car.
Northamptonshire Police say they were able to quickly identify Mellor as the suspect and he was arrested in Leicester the same day.
Mellor, of Kelmarsh Avenue in Leicester, appeared at Northampton Crown Court on Monday.
He pleaded guilty to offences of attempted rape, possession of a bladed article and breaching his sexual harm prevention order and will be sentenced at the same court on 10 June.
Det Con Adam Kelly said: "Matt Mellor is a very large man, about 6ft 10ins in height, and his actions on that night would have been an absolutely terrifying experience for this woman who should have been able to walk wherever she liked without fear of such an attack.
"She showed tremendous bravery in fighting him off while shouting for help and I would like to thank her for her support and courage during our investigation.
"I would also like to thank the local residents who quickly came to her aid that night and also to local businesses in the area who have assisted us with our enquiries and the procurement of CCTV which helped us piece together this crime.
"To be able to take such a dangerous offender off the streets helps to make Northamptonshire a safer place for people to go about their daily business and I now expect it will be a long time before Mellor is released from prison, which is great news."