A Dublin man who denies murdering his close friend told gardai that the deceased became aggressive and attacked him over prank calls.
Martin Toland (34) said victim Alan Nolan (28) believed that Toland's sister was behind a series of calls he had been receiving.
Toland, of Walkinstown Park, has pleaded not guilty to the murder of Mr Nolan in September 2007.
He told gardai that Mr Nolan had said "whoever is making those calls should be shot", before producing a knife and coming towards him.
Toland has also denied a second charge of intentionally or recklessly causing serious harm to James Carroll (30) at Cedarbrook Walk, Ballyfermot, in September 2007.
Mr Carroll survived two stab wounds, to the heart and stomach, and has given evidence in the trial.
Garda Jason Miley, who arrested Toland, told the Central Criminal Court that the accused claimed that he had been acting in self-defence.
Giving evidence on day four of the trial, Garda Miley said that, while in custody, the accused described how his sister Niamh Toland had been good friends with the deceased man's sister Roisin Nolan, but that the two had fallen out.
After that, Ms Nolan had been receiving "nasty" anonymous calls, and taxis and take-aways that she hadn't ordered had been arriving to her house.
The accused told gardai that he spent Friday night, September 7, drinking and playing poker with Mr Nolan and Mr Carroll at Mr Nolan's Ballyfermot apartment, in Cedarbrook Walk.
He said that Mr Nolan was drunk and "sloppy" and accused his sister of making the prank calls.
"He said he believed my sister was behind it all, and it would come back on my house," Toland said.
"I said it shouldn't interfere with our friendship."
A struggle broke out between the two men downstairs, and then they went upstairs to the main bedroom to "sort things out".
"He started going on about whoever was making them phone calls was going to get shot," Toland told gardai.
He said Mr Nolan then produced a knife and came towards him, and during the ensuing struggle he managed to get the knife.
Toland told gardai that he could not describe "the fear I was in in that house", because he had recently had half a lung removed, and he thought he was going to get a hiding.
"Alan knew... I was on all this medication... and how I'd have to avoid any trouble... He knew one belt would kill me."
He said he was waving the knife at the two men and asking them to let him leave the house peacefully, and that he couldn't remember stabbing anyone.
The case resumes today before Mr Justice Patrick McCarthy.