A transgender woman who headbutted a bar manager will remain behind bars - but a judge has said prison officials should reconsider where she serves her sentence.
Tara Hudson was handed a 12-week custodial term by magistrates following a drunken attack on a bar manager.
The make-up artist has lived as a woman all her adult life and had six years of gender reconstruction surgery, but is still legally classed as male.
She tried to appeal against her sentence - saying it was excessive and she had suffered a torrid time while locked up in the all male Category B prison HMP Horfield in Bristol.
Recorder Llewellyn Sellick dismissed the application, given Hudson's "appalling criminal record", but said the Prison Service should give "sensitive consideration" as to where the 26-year-old would serve her sentence.
HM Prisons Service said it refused to comment on individual cases - however it added its guidelines did allow for discretion.
A spokeswoman said: "It is longstanding policy to place offenders according to their legally recognised gender.
"However, our guidelines allow room for discretion and in such cases, medical experts will review the circumstances in order to protect the emotional wellbeing of the person concerned.
"Our top priority is the safety and welfare of those in our custody and decisions relating to the location of transgender prisoners are taken by a range of people including psychologists, healthcare professionals and prison staff."
Last week Hudson appeared at Bath Magistrates' Court on a charge of assault at Be At One Bar in Bath on December 26 last year.
She initially denied any wrongdoing and claimed self defence but changed her plea on the day her trial was due to start.
The court heard a very drunk Hudson had headbutted the bar's manager Christopher Dyer after being refused to be served with any more alcohol.
Mr Dyer later needed £1,500 worth of dental surgery following the attack.
Hudson, who has eight previous convictions including offences for battery, had hoped her punishment would see her placed on electronic tag and undergo an alcohol awareness course.
Magistrates said the assault, which came three weeks after Hudson had been given a conditional discharge, was so serious that only custody be justified.
She was then sent to HMP Horfield which holds around 600 young adult and adult men.
The decision irked Hudson's mother Jackie Brooklyn, 48, who said there was nothing male about her daughter.
"Nobody would know the difference," she was reported as saying.
"She looks like a woman. She's gorgeous."
A petition calling for Ms Hudson to be transferred to an all female prison attracted more than 125,000 signatures ahead of today's hearing.
At Bristol Crown Court, a visibly startled looking Hudson sat in the dock in a prison-issue grey tracksuit while her barrister Nicholas Wragg called for his client to be freed.
Mr Wragg said Hudson had been separated from the rest of the prison population and "locked in a cell 23 hours a day".
"The clang of a prison door should never be pleasant. It should have a sobering effect on a person," he added.
"But Ms Hudson has had an awful time - she has found it unrelenting and frightening.
"As she left prison today to come to court - where she was placed in a female cell - she found herself taunted by other inmates shouting 'Tara Tara, show us your tits'."
The court heard Hudson had seen mental health professionals after suffering with psychotic symptoms since 2009 - which had been made worse since going to an all male jail.
In dismissing the appeal, Recorder Sellick ruled the attack on Mr Dyer had breached a conditional discharge given three weeks previously.
However, he added: "It is for the prison service, and not the court, to establish where a sentence should be served.
"We would invite further and sensitive consideration of these issues (in Hudson's case)."