David Gilroy moved in with the book keeper when his wife learned of the affair, but later returned to his family.
The man accused of murdering Suzanne Pilley admitted to police he had cheated on his wife with the missing book keeper.
David Gilroy told police that he misled his wife about his relationship with Ms Pilley, 38, when he spoke to officers two days after she disappeared.
The 49-year-old made the admission during an 11-hour interview with police on May 6, 2010, the High Court in Edinburgh heard on Thursday.
Gilroy told police sergeant Paul Grainger that he had told his staff nurse wife that he was working when he was actually seeing Ms Pilley.
His wife later found out about the relationship and had felt "betrayed", Gilroy told police. He said the discovery prompted him to move in for a time with Ms Pilley, but their relationship ended and he returned to his family, the court heard.
Gilroy is accused of murdering Ms Pilley at Thistle Street in Edinburgh, or at another location in Scotland, on May 4, 2010.
During the ninth-day of trial at the High Court in Edinburgh, Mr Grainger said he had interviewed Gilroy at Corstorphine police station two days after the book keeper went missing.
Gilroy told the officer that his relationship with Ms Pilley started after he did some odd jobs around her flat in the city's Whitson area.
She had told him that she had been abused in a previous relationship and had met her soulmate during a trip to Morocco but had ended that relationship to return to Scotland.
Ms Pilley also allegedly told Mr Gilroy that she was engaged to another man in Edinburgh, but that relationship had ended because the man had a "major cocaine problem".
Mr Gilroy also told police that Ms Pilley had told him that she had a "termination" when she was younger but now wanted to have children.
Sergeant Grainger told the court he noticed Mr Gilroy had a number of injuries during the interview.
He said: "I noticed a scar on his forehead under his hairline. There may have been some sort of scratch to his neck under his chin.
"He was quite happy to come and assist us. There was nothing unusual or different about him."
Gilroy, of Silverknowes, Edinburgh, denies a total of five charges which allege he committed a series of criminal acts across Scotland between August 2009 and June 2010.
The trial before Lord Bracadale continues.
IN DETAIL
David Gilroy told police that he misled his wife about his relationship with Ms Pilley, 38, when he spoke to officers two days after she disappeared.
The 49-year-old made the admission during an 11-hour interview with police on May 6, 2010, the High Court in Edinburgh heard on Thursday.
Gilroy told police sergeant Paul Grainger that he had told his staff nurse wife that he was working when he was actually seeing Ms Pilley.
His wife later found out about the relationship and had felt "betrayed", Gilroy told police. He said the discovery prompted him to move in for a time with Ms Pilley, but their relationship ended and he returned to his family, the court heard.
Gilroy is accused of murdering Ms Pilley at Thistle Street in Edinburgh, or at another location in Scotland, on May 4, 2010.
During the ninth-day of trial at the High Court in Edinburgh, Mr Grainger said he had interviewed Gilroy at Corstorphine police station two days after the book keeper went missing.
Gilroy told the officer that his relationship with Ms Pilley started after he did some odd jobs around her flat in the city's Whitson area.
She had told him that she had been abused in a previous relationship and had met her soulmate during a trip to Morocco but had ended that relationship to return to Scotland.
Ms Pilley also allegedly told Mr Gilroy that she was engaged to another man in Edinburgh, but that relationship had ended because the man had a "major cocaine problem".
Mr Gilroy also told police that Ms Pilley had told him that she had a "termination" when she was younger but now wanted to have children.
Sergeant Grainger told the court he noticed Mr Gilroy had a number of injuries during the interview.
He said: "I noticed a scar on his forehead under his hairline. There may have been some sort of scratch to his neck under his chin.
"He was quite happy to come and assist us. There was nothing unusual or different about him."
Gilroy, of Silverknowes, Edinburgh, denies a total of five charges which allege he committed a series of criminal acts across Scotland between August 2009 and June 2010.
The trial before Lord Bracadale continues.
IN DETAIL