Michael Raymond Richardson, 50, of Harewood Road, Deepdale, Preston, went on to assault a woman and smash windows at the flat.
At one point Richardson, who has 12 convictions, was recorded on CCTV in possession of a samurai sword and a file in his left hand during the incident on Harewood Road, Deepdale.
He admitted causing actual bodily harm, affray, two counts of possession of a weapon and two of criminal damage during a hearing at Preston Crown Court
Verity Quaite, prosecuting, said: "In summary Mr Richardson attended outside the home of his ex partner on two occasions on New Year's Eve.
"Shortly after 8pm he knocked on the window of her home.
"When she opened it to speak to him she told him to leave but Mr Richardson smashed her window.
"Shortly after 10pm Mr Richardson returned again. There was a confrontation with her.
"On that occasion Mr Richardson was in possession of a wooden handled axe."
The court heard a woman came out of the flat and he grabbed her by the collar and swung her round and pulled her onto the ground.
Whilst on the ground he punched her. She was also allegedly kicked by another man, who faces a trial later in the year.
The woman suffered a scratch to her stomach, a black eye, pain to her body and legs and her false teeth were displaced.
In an interview Richardson made no comment.
Philip Holden, defending, said Richardson had armed himself because he was "fearful" the woman's new partner was "looking for trouble".
He added: "He didn't go over there to assault her.
"He had been threatened, he says, by her partner over the course of the preceding days and was told by her that he was coming round with a weapon."
Judge Sara Dodd replied: " Isn't the sensible thing to do to lock the doors and stay inside?
"Even on his account he was ready to meet trouble, if I can put it like that."
However, she suspended his 18 month jail term for 21 months, acknowledging he had already been on remand for five months during the Covid pandemic, which has seen prisoners confined to their cells for most of the day.
She added: "I've seen the footage of what went on in the immediate time before it started.
"When you got her to the floor you punched her, Others then set about her.
"It was your actions that led to that."
He must complete a rehabilitation activity.
The Lancashire Post is more reliant than ever on you taking out a digital subscription to support our journalism. For unlimited access to Lancashire news and information online, you can subscribe here.