An assault victim sought solace from his ex-partner - despite knowing there was a court order banning him from visiting her.
Carlisle's Rickergate magistrates' court heard that it was the fifth time 28-year-old Elijah Ali had flouted the order since magistrates imposed it in February.
After hearing the details of the offence, District Judge Gerald Chalk jailed Ali for 120 days.
John Moran, prosecuting, described how Ali had turned up at the woman's address in Petteril Bank Road on November 29, and began shouting for her to open the door.
"The defendant did make a comment to the police that he was going to keep breaking the restraining order until he sees his kids, and he said that they couldn't stop him," said Mr Moran.
The prosecutor said the defendant had already spent time in jail for breaching the restraining order.
Mr Moran said Ali needed to sort out his differences with his former partner through a court process.
Mark Shepherd, for Ali, said that when he saw the defendant at the city's Durranhill police HQ early on Thursday morning he had suffered a significant injury to his eye.
This had led to him needing hospital treatment.
Ali, living in Lowther Street, Carlosle, had been badly assaulted and his mobile phone was taken off him, said the lawyer.
Mr Shepherd added: "He knows that if he continues to breach the court order he will spend a great deal of time in custody."
As he jailed Ali, District Judge Chalk said the restraining order would remain in place.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here