A teenager who raped a 14-year-old girl in a West Lothian park was caught using DNA evidence, a court heard.
Walker was jailed for seven years
Scott Walker, 19, was arrested when DNA found on the girl's clothing linked him to the crime.
The girl was playing with friends in a Bathgate park in March when Walker dragged her into bushes and threatened to kill her before trying to rape her.
Sentencing the painter and decorator at the High Court in Glasgow, judge Lord Philip described the attack as a terrible offence against a defenceless young girl.
The defence alleged that the assault was not premeditated and Walker was sorry for what he had done.
However, Lord Philip said that the seriousness of the attack meant that Walker should serve an extended sentence of seven years in jail and three years under supervision.
The judge said: "It is necessary to impose a substantial sentence so that the gravity of the offence can be recognised."
Lord Philip said that the risk of Walker striking again justified the sentence and would ensure that he could undergo treatment.
He said: "The sentence has to be a certain length for full treatment."
Walker, of Race Road, Bathgate, was caught after police found traces of his saliva on the girl's trousers.
The teenager admitted to stamping on the girl's throat and attempting to rape her.
Walker, who has been placed on the sex offenders' register, said nothing as sentence was passed.