A woman fought off a sex attacker by hitting him over the head with a stone.
Grzegorz Budach, 24, who ambushed the woman as she was on her way to a party in the Lochee area of Dundee, was jailed for three and a half years on Thursday.
Advocate depute Shirley McKenna, prosecuting, described how Budach picked the woman up in a "fireman's lift" and carried her to nearby bushes where he ripped off her clothes.
She said: "She managed to reach out and get a stone which she used to strike the accused on the head."
Budach continued his attack, ignoring the woman's screams and throwing her mobile phone away when she tried to use it.
The struggling woman hit him again with a stone before running along Coupar Angus Road where a passer-by helped her to get to a police station.
A search of the area near the corner of High Street and Coupar Angus Road found clothing, jewellery and coins scattered about - as well as footprints matching Budach's trainers. They found muddy clothing in his Dundee home.
Budach had scratched knees and injuries to his nose and forehead "consistent with the use of blunt force impact," said Miss McKenna.
Budach, who moved to Edinburgh, admitted attempted rape on September 17 last year.
Sentencing him at the High Court in Edinburgh on Thursday, judge Lord Bannatyne told Budach he was guilty of a "serious and nasty" offence.
Solicitor advocate George Pollock, defending, said Budach had not been in trouble before, either during his stay in Scotland or, previously, in Poland. He had expressed remorse for what he had done.