A convicted sex offender has admitted robbing, raping and murdering a vulnerable pensioner in her sheltered housing home.

Kevin Rooney, 26, had previously been locked up for sexual offences against two young boys and persistently breaking the rules of a sexual offences prevention order.

Rooney – who has 36 previous convictions – admitted murdering 74-year-old dementia sufferer Rosina Sutherland at her bungalow in Edinburgh last year.

He killed the grandmother after ransacking her home in Longstone, sexually assaulting her, repeatedly hitting her on the head and body and compressing her throat, restricting her breathing.

Rooney, who had been on trial at the High Court in Aberdeen for two days before lodging the guilty plea, robbed Ms Sutherland of money, keys and her walking stick during the attack on October 29. He was on bail at the time.

Advocate depute Alison Di Rollo said Rooney's extensive list of previous convictions included wilful fire raising, theft and housebreaking, but he was also convicted of a sexual offence at high court level in 2004.

She said: "He was convicted of lewd and libidinous practices in relation to two boys under the age of 10. He was sentenced to two years' detention at a young offenders institute."

The advocate depute said Rooney was handed a sexual offences prevention order in 2007, but added: "He has been convicted of breaching this order on several occasions and has on three occasions been sentenced to periods of imprisonment for being in contact with children under the age of 16 and failing to reside at approved accommodation.

"He was on bail at the time of the commission of this offence for a variety of offences including vandalism and shoplifting."

Before he admitted murdering the pensioner, a jury had heard details of his bizarre behaviour in the hours after the attack.

Police witness PC David Moran said Rooney confessed to murdering someone after they detained him for an unrelated matter a few hours after the attack. He told the officer he would lead him to the body in return for a cigarette.

The officer, 28, said he confiscated almost £330 from Rooney. The killer was spotted in the Longstone Inn on the night of the murder "flashing" hundreds of pounds in cash with a walking stick that Ms Sutherland's daughter Teresa had identified as belonging to her dead mother.

Pub licensee Karen Walker, 43, said he had "bundles" of cash and offered to buy strangers drinks.

And customer Stephen Brown, 26, said Rooney was carrying a walking stick and had walked with a limp. The delivery driver said: "He was telling me that he used to be in the Army. He says he got shot in the leg when he was in the Army. That's why he had the limp."

CCTV footage of Rooney at the Longstone guesthouse where he was staying on the day of the murder was shown to the jury. He was seen walking without a limp or the use of a cane.

On Tuesday, relatives of mother-of-five Ms Sutherland gave evidence.

Her son-in-law, Robert Iannelli, 45, told how he discovered her body lying with a towel neatly folded over her face in her "trashed" bedroom. His wife Teresa, 44, said she had planned to take her mother to buy a new bed later that day and said the pensioner had withdrawn the cash she needed – £1200 – on two separate occasions.

Mrs Iannelli said she had worried about security at her mother's home and would often lock her inside at night because she did not have the strength to work the security handle on her own. She said she often found her mother had placed step- ladders up against the door in a bid to secure it.

Another of Ms Sutherland's daughters, Jane Sutherland, 48, broke down as she remembered the last time she saw her mother, on the afternoon of the day Rooney struck. She wept: "I gave her a cuddle and told her I loved her."

Details of the murder will be heard at the High Court in Edinburgh tomorrow.