A rapist who escaped justice for seven years following an attack in Greyfriars Kirkyard in Edinburgh was caught by a DNA swab.

Cy Sullivan, 26, raped his 46-year-old victim on November 27, 2009, leaving her naked from the waist down.

DNA was recovered but at the time there was no match in the national database.

Sullivan, a commercial diver, was linked to the crime when he was charged with assaulting a bouncer in October 2015 and a routine DNA swab was taken. His DNA matched that of the Greyfriars Churchyard rapist.

Sullivan, from Shetland, claimed he and his 46-year-old victim had consensual sex but a jury convicted him of raping her while she was so intoxicated she could not given consent.

On Friday, at the High Court in Glasgow, judge Lady Rae jailed Sullivan for five years.

She told him: "You raped a lady almost twice your age. You took advantage of her intoxicated state.

"She has been left seriously traumatised by what you did and with having to relive what she remembered, and the shame and embarrassment she felt when she was discovered by police in the state of undress that you left her in. She was a stranger to you."

The court heard the victim was found by police after the rape wandering half naked in the cemetery in a confused and drunken state. She described what happened to her as "a living nightmare."

In evidence, she said she travelled from her home in the Highlands to attend a conference in Edinburgh and decided to visit the grave of Greyfriars Bobby.

The woman said she had at least eight glasses of wine.

A police officer who saw her hours later at 5am described her as "intoxicated".

The court heard police officers saw the woman standing at railings inside the graveyard.

She was taken to Gayfield police station and then examined by doctors and a DNA sample was taken.

The victim, who cannot be named for legal reasons, was asked by prosecutor Ian Wallace: "Do you remember leaving Greyfriars pub?"

She sobbed as she said: "No. I remember coming round in the graveyard and there was a police lady. I was frozen and I was disorientated. I tried for some time to find my way out.

"It was like something happened and I had just come round. It was awful. I just felt awful, embarrassed. I had no clothing on my bottom half."

The woman told the jurors that she had no memory of what happened after she left the pub until the police found her.

She was asked if she had any recollection of anyone having sex with her and replied: "No."

Mr Wallace then asked: "Did you want to have sex with anyone that night?"

The victim said: "Definitely not."

Sullivan told the court he had bought the woman a drink and then afterwards had sex with her. He claimed she appeared fine to him and not drunk.

His defence counsel David Nicolson said: "His family maintain their support of him, particularly his partner of three years.

"He has a good work record and has only one previous conviction."

Lady Rae placed Sullivan on the sex offenders register.