A young mum pressed a panic alarm after she found a teenager banned from contacting her in her home.
The 17-year-old said she was frightened by the intrusion into her home by Alexander Buckley.
Buckley, of Halifax Road in Birchencliffe, was already on court bail accused of breaching his order to keep away from her previously.
This order included a ban on him going within 100 metres of her home close to Huddersfield town centre.
But the 18-year-old was arrested after ignoring this on September 1 when he went to the mum-of-one’s address.
Prosecutor Alex Bozman said that the girl, who cannot be named, was upstairs when she heard Buckley entering the house.
He said: “She heard the door squeak and then footsteps coming up the stairs. Mr Buckley was there on the landing.”
Kirklees magistrates were told that the mum then allowed Buckley to play with her baby son while she went and activated an alarm alerting police.
Mr Bozman said the teenager was uncooperative with officers when they arrived.
As they tried to arrest Buckley for breaching his court order he struggled with them.
Mr Bozman said: “The officer took hold of him by the right arm. At that point Mr Buckley pushed him in the chest and tried to tear his arm from his grip.
“There was a struggle and the officer rugby tackled him to the ground.”
Magistrates heard that Buckley continued to shout and swear until the officers arranged for a police van to attend and take him to the station.
They were told that this happened while he was on bail for matters of assault and further breaches of the order, all involving the same girl.
Mr Bozman said: “She says she’s really scared of the defendant and doesn’t want him to have any further contact with her.”
Buckley admitted to breaching the order by going to the address as well as assaulting a police constable in the execution of his duty.
Mike Sisson-Pell, mitigating, said that his client panicked when police went to handcuff him.
The solicitor asked magistrates to release him until his other charges are dealt in November.
Magistrates remanded Buckley into custody.
He will next appear in court via a prison video link this Thursday.