Alan Saville, 76, who was awaiting a triple heart bypass operation, struggled with former squaddie Robbie Morrison, who had broken into his house in Spylaw Road.
The retired businessman tried to kick and punch the thief, who he found lying next to his bed after being woken in the middle of the night by creaking floorboards.
The pensioner eventually fled from the house, returning with his son-in-law, who lives across the road, and the pair forced Morrison to leave. Morrison, who now faces jail after admitting the attack, was branded “despicable” by a sheriff.
But Mr Saville, who is now recovering from the heart surgery, said he felt sorry for the 28-year-old, who served on two tours of duty in the forces.
He said: “He was right next to me beside the bed. I swung my legs out of bed and tried to kick him as I got out.
“I swung a punch at him, thought ‘I don’t think it hit’, and I tried to kick him in the groin.”
He escaped the house and alerted son-in-law Antonino Allenza, 56, who lives across the street with Mr Saville’s daughter.
She called police while her husband and father struggled with Morrison.
They were able to force him out the house, but he tried to push his way back in by wedging the door open with his arm.
Mr Saville said Morrison, who demanded cash from the pensioner and stole two mobile phones during the robbery, was armed with a blade and left a trail of blood throughout the house.
He added: “I understand he spent four years in the army. I felt sorry for him in a way because he obviously hadn’t settled down to civilian life.”
He added: “If he can be prevented from doing it again that’s the main objective. I hope he learns from whatever punishment he gets.”
Morrison’s solicitor, John Good, told Edinburgh Sheriff Court earlier this week the accused was “troubled” by what he had done to Mr Saville last June.
Morrison had been discharged from the army and had problems with Valium and heroin and was currently serving a prison sentence for theft.
Sheriff Deirdre MacNeill delayed sentencing for reports and said: “This is the most despicable type of event.
“It’s difficult to see that there is any appropriate disposal other than custody.”