A mother-of-four was sent to a court's cells for arguing with the judge.
Naomi Moseley refused instructions from District Judge Kristina Harrison to be quiet while her case was dealt with.
Judge Harrison found Moseley in contempt and ordered her to be locked up.
Moseley, who arrived at Teesside Magistrates' Court on bail, spent nearly two hours in the cells before defence solicitor Nicola Horton told the judge she had calmed down.
"She would like to apologise if given the opportunity," said Ms Horton.
Moseley was brought back to court when she apologised to the judge and her case continued,
Prosecutor Lynne Dalton said Moseley was due to be sentenced for stealing her flatmate's phone after the pair fell out.
"Ms Moseley says she has since paid for the phone, but it's not entirely clear if that is so," said Ms Dalton.
"Some money has been handed over, but the victim's mother thinks that may have been for a separate debt."
Ms Dalton said the argument broke out when Moseley returned to the flat when drunk.
Moseley, 24, of Rossall Street, Hartlepool, admitted theft, and putting her flatmate and two mental health support workers in fear of violence, all on June 12.
She has previous convictions for 13 offences.
Moseley failed to comply with previous community orders, the court heard.
"She has had a terrible time of it having suffered more than one instance of domestic violence," said Ms Horton.
"I have to accept she has not complied with previous orders, but her lifestyle has been chaotic, taking drugs and drinking to excess..
"She has four children, including one with a brain injury caused when she was beaten while pregnant.
"None of this excuses her behaviour, but she would like one last chance."
Judge Harrison sentenced Moseley to 16 weeks in prison, suspended for 12 months, 20 rehabilitation activity days, an alcohol treatment programme of six months and ordered her to pay £155 costs.
"The only question is whether I have to send you straight to prison today," the judge told Moseley.
"These offences were not so serious, but you have failed to comply with court orders in the past.
"You should understand there will be no more chances after today.
"Breach this order, you will come back before me, and you will go to prison for the 16 weeks."