Simon Roy Hoare, 19, jumped his victim from behind as she walked down Hengoed Lane, near Oswestry, dragging her through muddy fields by her hair and throttling her until she thought she would die, Shrewsbury Crown Court heard.
Judge Robin Onions said Hoare, of Berwyn View, Ellesmere, was a danger to the public and would not be released from custody until a parole board decided it was safe to do so.
Hoare, who admitted two sexual offences, including rape, will serve at least two years and 301 days before he can apply to the parole board for release.
Mr Gareth Walters, prosecuting, told the court the victim had been walking past Hengoed cemetery in the early evening of April 6 when she was attacked.
"She was overpowered, carried across the road, taken behind a hedge and dropped into some nettles.
"She was grabbed by the throat and it effectively stopped her breathing, she thought she was going to die. She was then dragged into a second field and when she kept struggling he kept choking her."
Mr Walters said the victim tried to convince Hoare to stop but he continued sexually assaulting and raping her. He then ran from the scene and she returned to the road and flagged down help.
Witnesses later identified Hoare and forensic evidence found hairs from her cardigan in the car he was driving that day.
Mr Mike Sherwood-Smith, for Hoare, said Hoare did not remember anything of the attack but pleaded guilty due to the forensic evidence.
The court heard Hoare had previous convictions for violence, including one of robbery in which he followed a schoolgirl in Oswestry before attacking her in an alleyway and stealing her mobile phone.
Judge Onions said Hoare was a dangerous young man and a significant risk to members of the public of serious harm.
He will be detained in a young offenders institution and then prison when he turns 21.
He was made the subject of notification requirements under the Sexual Offences Act for the rest of his life.
By Rhea Parsons