Two thugs armed with a "gun-shaped bong" kicked down a woman's door during a terrifying confrontation.
Reece Smith, 23, and Jed Wilson, 19, smashed their way into the woman's room in shared accommodation at Eden Vale, Sunderland, and asked her male visitor to fight them.
The 20-year-old victim suffered an injury to her finger in the stand-off and thought the weapon was a handgun.
Newcastle Crown Court heard Smith had previously been in a relationship with the woman and they lived in the same building.
The trouble flared on February 4 when the victim had a male friend in her room.
Prosecutor Yvonne Taylor told the court Smith had called the woman offensive names when she bumped into the men on the way to the communal bathroom.
Miss Taylor added: "She went into her room at that point.
"Both defendants kicked at her door. She got the door closed and was trying to put the chain on.
"Smith was still kicking the door and as a result of those actions it caused her to hit her thumb, which resulted in pain and redness.
"Before she could dial 999 they kicked the door through, causing half the door frame to come off the wall.
"Smith entered the room with what was described by the complainant as a handgun in his hand."
The court heard Smith was "waving" the weapon, which he claims was a gun-shaped smoking device, at both his ex and her visitor.
Miss Taylor said: "Smith was shouting at her friend 'get outside and fight us'.
"He was saying 'is this your boyfriend?, what's he doing here?, who is he?'."
Miss Taylor added: "Wilson was telling the man to get outside".
The court heard the men left he house before the police arrived and were arrested later.
Smith was carrying a small bag of cannabis.
Smith, of Jacks Street, Pallion, Sunderland, admitted common assault, criminal damage, possession of an imitation firearm with intent to cause fear of violence and possession of cannabis.
Wilson, of Neville Road, Pallion, admitted common assault, criminal damage, possession of an imitation firearm with intent to cause fear of violence and possessing a lock knife which police found down his sock during an earlier, completely unrelated incident.
Mr recorder Simon Goldberg said Smith was the "prime mover" in the attack at the woman's home, which he said was "extremely frightening" and sentenced him to 20 months behind bars.
The judge told him his offending was "motivated by jealousy that your ex partner had moved on".
Wilson, who was on a suspended sentence at the time, which the judge has now activated, was jailed for a total of 28 months.
The judge told him; "Why it is you got involved in this incident, which had nothing to do with you, is not immediately apparent."
Defence barristers said both men have done well while in custody on remand and have completed courses and programmes to try and improve their futures.
Tony Cornberg, defending, said the weapon used in the offence was a "gun-shaped bong" which was later found on Smith's window sill by the police.
Vic Laffey, defending Wilson, said: "It wasn't his argument but he got involved in it."