A man was murdered during a confrontation with a teenage stranger his partner had just had sex with during a party at their home, a court heard.
Callum Hackett had sex with Donna Hawthorn after being invited to a drinking session at the house she shared with long-term partner David Savage, 42, last September, it is claimed.
Hackett, now 18, was asked to leave the property in Gosforth, Newcastle, after Mr Savage saw him in an "embrace" with Miss Hawthorn, jurors have heard.
The court heard Hackett left, but came back looking for his gloves, which led to an angry stand-off where punches were thrown.
Hackett left again, but this time prosecutors claim he picked up a knife from a pal, which he used to stab Mr Savage twice in the chest when he came out into the street.
Mr Savage died as a result of blood loss.
Hackett, of Englefield Close, Kingston Park, Newcastle, denies murder, and is being tried by a jury at Newcastle Crown Court.
He told police when he was arrested he had been at the house, where he had alcohol and cocaine, for the first time, followed by sex with a stranger.
He said Mr Savage accused him of "messing with his girl", but denied being present at the time of the murder.
The court heard Hackett now accepts being present at the time of the killing, but continues to deny involvement in it.
Prosecutor Sam Green QC told the court Mr Savage and Miss Hawthorn had been drinking with friends at their home, and Hackett turned up after being invited in by a female guest.
Mr Green said: "At some point, the defendant followed Mr Savage's partner upstairs, where he and she had sex.
"When they had finished and gone back downstairs, Mr Savage saw the defendant and Miss Hawthorn in some kind of embrace.
"Perhaps unsurprisingly, that caused a change in Mr Savage's mood towards the defendant. Mr Savage asked the defendant to leave."
Mr Green said Hackett left the house, but came back to collect his gloves, which could not be found, and there was a violent confrontation, involving punches between him and Mr Savage, before he left again.
Mr Green added: "The prosecution say that what then happened is that the defendant obtained a knife and returned to Mr Savage's home.
"Mr Savage went outside and the defendant stabbed him and killed him."
The court heard Hackett and Miss Hawthorn had been caught having sex on her bed by another woman who was at the house, who "suggested they get back downstairs".
The pair finished having sex before they followed her advice.
Mr Green told jurors they should put moral beliefs and sympathy aside when considering the evidence in the case.
Hackett denies murder. The trial continues.