Alexander Brown, 73, attacked Elizabeth Tainsh with a hammer and tried to smother her with a pillow as she lay in bed.
The 57-year-old victim’s ordeal at their flat in Ferry Road, in Edinburgh, ended when she managed to break free.
Police later found Brown sitting in his car at the Forth Road Bridge. He later told officers: “I’ll be getting a sentence.”
The High Court in Edinburgh heard that a note stating “We will be in Heaven together” was recovered as Brown apparently planned a double death, intending to kill both his victim and himself.
A judge told Brown: “You pled guilty to the attempted murder of your long-term partner. It is clear you deliberately set out to kill her, wrongly believing she was about to leave you and was having an affair.”
Lord Boyd of Duncansby said: “As you will appreciate, a significant period of imprisonment must follow.”
The judge told him that he would have faced an eight-year prison term but for his guilty plea.
Lord Boyd declined to make a non-harassment order against Brown which the Crown sought to prevent him approaching or contacting or trying to approach or contact Miss Tainsh.
Advocate depute Steven Borthwick said the victim had been “deeply affected by the incident and remained fearful for her safety. He said: “There remains a concern - I cannot state it any higher than that - that this type of behaviour may be repeated were the accused to come off his medication again in future.”
Defence counsel Ronnie Renucci said that Brown had no intention of putting the victim through any further trauma at his hands.
He said: “He recognises that by his actions he put an end to that relationship, although it is a matter he regrets.”
Brown earlier admitted trying to murder Miss Tainsh on July 6 last year. She had gone to bed leaving him watching TV.
But in the early hours of the morning she was wakened by a blow to her head. She was then struck again before realising he was standing at the bedside.
He picked up a pillow and put it over her face, before applying pressure, restricting her breathing to the point where she thought she was suffocating.
The victim managed to fight back and push the pillow off, but Brown smothered her again before she broke free.
She realised he was holding a hammer and asked him to hand it over and he did so. She asked why he assaulted and was told it was because of an affair.
She told him that was not the case and he appeared confused and apologised before leaving the flat. The distressed victim called the police and was taken for treatment to her injuries.
Mr Renucci said: “It does seem to have been a premeditated act and he accepts that.”
The defence counsel said it was “a somewhat unusual case” and argued that the circumstances would allow the judge to perhaps show more leniency than in others.
“There has been a history of depression and paranoid thoughts,” he told the court. He added that there appeared to have been significant progress and there was no need for a treatment order or a hospital disposal.
“The decision he took that day is one he deeply regrets having regard to the effect it has had on his ex-partner,” said Mr Renucci.
“There is no indication at all that he presents a risk to society at large,” said the defence counsel.