A 14-year-old boy who admitted terrorising female strangers during a series of sex attacks has been detained.
Exeter Crown Court was told the youth, who cannot be named, stalked his victims in the dark on the Tarka Trail in north Devon.
After his arrest he told police the attacks had excited him.
Judge Graham Cottle sentenced the teenager to three years in a high security unit near Bristol.
His victims included a 49-year-old woman, two 19-year-olds and a 14-year-old girl.
Prosecutor Sean Brunton told the court the sex attacks took place over a month-long period from December to January along a deserted railway line which is part of the Tarka Trail.
His youngest victim was followed and attacked as she walked along her school route near her home.
Mr Brunton told the court the girl was subjected to a five to 10-minute ordeal, which has left her traumatised.
Barrister Richard Crabb, defending, said his client posed a "significant risk" which could be lessened with a high level of supervision.
Sentencing the teenager Judge Cottle said: "All were very nasty attacks on women who were very, very frightened as a result."
The judge said the youth, who will shortly be 15, will be treated at the Bristol centre so he can understand why he carried out the attacks and to try to make sure he does not do it again.
He is due to be released after 18 months of his sentence, after which he will be very closely monitored.