39-year-old Hardeep Sandhu was convicted by the Derby Crown Court after the DNA collected from the crime scene in May, 2013 matched with the samples he had given a year later after being arrested for drunken and disorderly behaviour.
Sandhu of Curzon Lane, Alvaston hit the woman, who was working as a prostitute at the time, with a brick, repeatedly punched her and raped her in a garden at the back of Hartington Street, Normanton, in May 2013, the Derby Telegraph reported.
The attack lasted for about two hours after which Sandhu fled. As the woman left the scene, she met a couple who helped her and called the police.
Scenes-of-crimes officers had obtained DNA samples from the garden. However, the identity of the offender was not given out.
In October 2014, Sandhu was arrested for drunken and disorderly behaviour, for which he was required to give a DNA sample. This matched the DNA samples collected from the scene of the May 2013 attack.