Ciaran Fleming went into a rage after his boyfriend spoke to another man at a party.
Fleming, of Sperrin Road, Limavady, denies a number of charges, including arson with intent to endanger life, threats to kill, assault occasioning actual bodily harm and criminal damage.
The incident took place at the rented flat of his 24-year-old alleged victim on 15 January last year.
Giving evidence on the opening day of the trial at Derry Crown Court, the alleged victim told the court he had been in a relationship with the accused for ten months and had been living with him at his Housing Executive flat at Alexander Road in Limavady at the time.
He said Fleming became “very aggressive” as they made their way home from a party in the Corner Bar in the town in the early hours of the morning because he had spoken to a male friend he had not seen for a number of years.
The victim said when they reached the flat, Fleming asked why he had spoken to the man and became verbally abusive and lifted a game console and smashed it against a wall.
He added that he phoned the police, Fleming punched him in the face, breaking his glasses.
At one stage, the victim said he prevented Fleming getting a combat knife from a drawer.
He said the accused then began to trash the flat and threatened to him kill before leaving through a window because he could not find the key to the locked door of the flat.
He added: “He said ‘If I don’t get my stuff tonight,’ he would kill me and he would be back and the house would ‘be done or set on fire’.”
He told the court he then phoned his mother and when she arrived she again phoned the police.
Earlier, a Crown prosecutor told the jury of six men and six women, the alleged victim sustained cuts and bruises to his face and arm, which required treatment at the A&E department at Altnagelvin Hospital.
The prosecutor, told the court when he returned home, he locked up his flat and went to bed.
The court was told Fleming returned to the ground floor flat and smashed a window to gain entry before putting clothes on the hob and in the oven of a electric cooker, which he switched on before leaving.
The prosecutor told the court the alleged victim was woken later by the sound of a fire alarm and found the flat filled with smoke.
The court was told Fleming was arrested by police a short distance away and when cautioned told officers he would kill the alleged victim and his family.
The prosecutor said: “He told officers ‘As soon as I get out, his family are all dead.”
The court was told Fleming was denying the charges, claiming he was acting in self-defence when attacked by the alleged victim.
The court heard when it was put to the accused how the alleged victim came by his injuries, he told police the alleged victim would be beat up by his sisters and photos posted on Facebook.
The trial continues.