A burglar was caught after his DNA was found on a can of lager he left at the crime scene.
Steven Craig Vonk broke into a flat in the street where he lives in Swansea last month, South Wales Police said.
But the 39-year-old, armed with a can of drink, ended up disturbing the home owner during the break-in and ran off empty-handed.
However, crime scene investigators swept the home for clues - and found a can of Carling which did not belong to the victim.
Forensic tests later showed the can contained Vonk's full DNA profile.
'A terrifying experience'
Vonk, of St Albans Road, Brynmill, later appeared at Swansea Crown Court and was sentenced to 876 days in prison for burglary and a further 12 weeks from a previous suspended sentence.
Detective Inspector Mark Kavanagh, of Swansea CID, said disturbing a burglar was a terrifying experience for any householder.
"Fortunately in this case the victim was unharmed and no property was stolen," he said.
"But when our investigation got under way it became apparent a can of lager had been left at the scene which did not belong to the victim.
"The can was forensically examined and contained the full DNA profile of Vonk. He was later traced and arrested for the burglary.
"Whenever a burglary is reported we use every tool available to us to try and identify a suspect.
"Forensic technology is an important way of catching burglary suspect and, in this case, leaving behind a can of lager has resulted in us putting the suspect before the court."
A few more crime-related stories for you:
Thefts exposed by Facebook photos
Women spared jail over flat theft
'Two in five' tourists victims of theft