The man accused of murdering four family members left his gold chain at the home of Mandy Power as a "love token", a jury has heard.
Mr Morris claims to have had an affair with Mandy Power
David Morris, 44, then convinced his uncle to buy an identical replacement when a chain found at the murder scene became a critical clue in the case.
The court heard he did not want to tell the police about the chain for fear of upsetting his partner.
Mr Morris denies murdering Mrs Power, her mother and two children in 1999.
Patrick Harrington QC, prosecuting, today told the jury that Mr Morris, a former scrap metal dealer, had continually lied to police about the chain to cover up his guilt.
On the third day of his opening address he outlined how police came to learn of his link to the chain and to eventually arrest him.
He said Mr Morris had told his uncle Eric Williams while they worked on a property days after the killings, that he had had sex with Mrs Power the day before she was killed.
He claimed he left the chain as a love token and had meant to get it back on the day Mandy Power died.
He told Mr Williams, a builder, he could not tell the police what had happened because he did not want to upset his own partner.
After Mr Williams had bought the identical chain at a second-hand jewellers in Swansea, Mr Morris 'roughed it up' and broke its clasp to make it look like the original, the court was told.
Mr Williams mentioned his nephew's affair with Mrs Power to another client several months later.
She was told to report it to the police after mentioning the affair to an off-duty policewoman and friend.
In the retrial at Swansea crown court, Mr Harrington said this led "inevitably and inextricably" to Mr Morris' arrest.
He said that after Mr Morris' arrest he was interviewed a total of 17 times but continued to insist the chain was not his.
It was only five days before the start of the original trial in April 2002 that he admitted it was.
Police first made public a gold chain from the crime scene was seen as a vital clue in August 12, 1999.
By then, Mr Morris had been interviewed by detectives and had established an alibi in his partner Mandy Jewell, the murdered mother's best friend, the court was told.
Former scrap metal dealer David Morris denies four murder charges
During the interview Mr Morris had underlined he still had his own gold chain that he claimed never to take off.
Mr Harrington said: "That was a blatant lie which goes straight to the core of this case.
"He is saying to the police in his statement 'I have my chain and I never take it off'. "Is it not highly significant that the account is measured, it is highly calculated, it is devious and it is inaccurate?"
After admitting he had not been at home in bed at the time when the killings had taken place, Mr Morris gave a new account of his movements, the court heard.
On the night of the killing, Mr Morris claimed to have walked alone in the rain from his flat with the intention of heading to his parents' home in Swansea.
But Mr Morris claimed to have turned back before arriving at his parents' home and eventually reached his own home at around 4am.
Mr Harrington described the account as "errant nonsense".
He told the jury a police officer had walked the 3.2 mile route that Morris claimed to have taken and completed it in 55 minutes.
Mr Morris said it took three-and-a-half hours on the night in question because he was drunk.
Mr Morris denies murdering three generations of the same family in June 1999.
Mrs Power, 34, children Katie, 10, Emily, eight, and grandmother Doris Dawson, 80, were all killed at their home in Clydach, near Swansea.
Their home was set on fire after their murders.
The case continues.