A woman said she deliberately scratched a burglar while he was trying to steal her laptop in order to get his DNA.
Annie-Laure Promonet, 42, found a man in her home in Watford, Hertfordshire, on 22 July and attempted to stop him.
Police were able to take scrapings from under her fingernails and found traces of tissue from Marvyn Mulvey, 40.
Mulvey admitted burglary and assault occasioning actual bodily harm and was jailed for seven and a half years at St Albans Crown Court on Friday.
Prosecutor Richard Jones told the court Ms Promonet had "made it her aim" to scratch Mulvey to obtain his DNA.
After the hearing, Ms Promonet said: "I thought I had to see his face, see if I could get his DNA, while all the time trying to memorise the clothes he was wearing.
"I didn't have time to panic. Maybe if I'd had a few more seconds then I would have realised it was a dangerous thing to do."
During the burglary, Mulvey used a wine bottle to beat Ms Promonet to the floor, leaving her with bruising to her body and head injuries.
She managed to hold on to her laptop, but Mulvey took a key to her flat and left.
He was later traced through his DNA and was arrested.
Judge Graham Arran said Ms Promonet had shown a "very cool head" during the burglary.
"She did what was was necessary to bring this defendant to justice and showed enormous bravery in preventing him escaping from her flat," he said.
At a crown court ceremony, Ms Promonet will be given an award of £350 out of public funds for her bravery.
In a letter to the judge, Mulvey apologised and said: "What I have put her though, no-one should have to go through."