It began simply as the sad personal story of one teenage shop- lifter who couldn't stop stealing, even when pregnant. Then a judge refused to let her out of jail a fortnight early so her baby could be born outside prison. Now the case is turning into a battleground between two competing ideologies of law and order. Until this week the heavily pregnant girl at Eastwood Park prison was just another 17-year-old with a shoplifting problem. She'd been stealing since she was 14 and had been convicted nine times in all. This last time she hadn't actually nicked anything herself but had acted as an look- out while an accomplice stole four shirts worth pounds 60 from Marks & Spencer in Cheltenham.

A week ago the magistrates in Cheltenham's youth court decided that enough was enough. This time the girl - who cannot be named - was going to jail, pregnancy or no. The family was no stranger to prison - her mother also has a criminal record and her boyfriend is now in prison - and now the girl had been found guilty again. She'd breached numerous non-custodial penalties in the past so this time a five month sentence was imposed and the girl was taken to Eastwood Park in Gloucestershire.

This week she was back before another judge - this time at Gloucester Crown Court - where her lawyers were applying to have her sentence reduced on appeal> They asked for it to be reduced by just two weeks - so that she would be released in time to give birth. "Her baby is due on November 12 when she will be still be serving the sentence.," her barrister, Carolyn Poots, said to the court. "She will have the child, and it will then be taken away from her. Her record of eight previous shoplifting offences is not the worst this court will have seen. She is at a crossroads and I ask that she be given one last chance."

But Judge Gabriel Hutton thought the girl had already had rather a lot of chances. He was told that the girl was too young to be transferred to a women's prison with facilities for new mothers and so would give birth in a Bristol hospital. The child would go into temporary care and the shoplifter would go back to jail to finish her sentence.

"We accept that the immediate loss of your child after the birth will be a real punishment," said Judge Hutton. "But you deserve a real punishment to try to break once and for all this habit of stealing other people's property. We are quite satisfied that only a custodial sentence can be justified."

A Cheltenham radio station called the Howard League for Penal Reform for comment and the League made sure that a local story went national. Prison reformers condemned the judge's remarks as "outrageous, immoral and unlawful". Most national newspapers carried the story yesterday and some scrutinised the 65-year-old judge's record. "He once freed sex fiend" rea a Mirror headline over a story that Judge Hutton had freed a man who had subjected an eight year old girl to a series of sex attacks and that he had told the court: "It seems on the evidence that this child has not suffered as a result of these offences." The story added that he lists his hobbies as hunting and fishing.

So far, so familiar. The press and prison reform movement had got their teeth into a story and weren't going to let go. The Prison Service clarified the situation yesterday and said that in certain circumstances it could grant a request to send a 17-year-old to an adult prison. "If we receive a request, we would consider it," said a spokesman.

But not everyone thought it was such a scandal. "I consider what the judge did to be entirely justified," said the former Prisons Minister and Tory MP Ann Widdecombe. "Society has already given her every last chance and the judge reached a point where it really had to be prison."

Once sent to jail the sentence should not be adjusted to take into account circumstances like a pregnancy, she said. "The Prison Service needs to work to find a way to give her access to its facilities. But you do not say: we don't send her to prison. I am sick of everyone putting responsibility on the judge, on the government of the day, on the lawyers. The girl has responsibility as well. We have got to start putting the responsibility on the criminal, and not on the judge. The girl knew this would be her last chance. She knew she was pregnant. She knew she was taking a risk."

When I called Miss Widdecombe at her home in the constituency she said she'd just been discussing this on the Jimmy Young Radio Two programme and had had lots of support from callers. A BBC spokeswoman described the reaction as mixed, but there is no doubt that there is a new and uncompromising mood gaining ground in the country when it comes to youth crime. At the same time that the 17-year-old girl was making headlines, Home Secretary Jack Straw was publishing his detailed plans to "break the excuse culture" surrounding youth crime. The plans include legally forcing parents to control their delinquent children. (It would be interesting to see how they would be applied in this case. Details of the girl's family were not made public except to say that her mother had convictions herself and would not be available to care for the baby.)

Predictably enough none of this impresses Paul Cavadino of the National Association for the Care and Resettlement of Offenders "Separating a baby from their mother shortly after birth can have a traumatic effect on the child, damange the bonding process and be a cause of later instability and deliquency," he said. "So a sentence intended to combat crime could increase the risk of criminal behaviour in future generation."

Yesterday Frances Cook of the Howard League was still fuming. "We are all outraged. What the judge has done is to create an atmosphere of punishment and revenge, and when you do that you create victims out of criminals. This girl has committed offences. It has created a nuisance and something must be done about it. But not this. It's so cruel and it makes her into a victim." There are various programmes, she said, that aim to tackle the problem of persistant shoplifting without imposing a sentence "Of course you should deal with it but this is so disproportionate. It's expensive too. It costs pounds 300 to pounds 400 a week to keep someone in prison and that adds up over five months. The reoffending rate among juveniles show that 90 per cent are reconvicted within four years. If society does have thousands of pounds to spare - as it seems to here - then let's spend it in a way that deals with the problem. That's not being soft on crime. That's being hard-headed."

But it was more than that. Judge Hutton, she said, was only being asked to reduce the sentence by two weeks, not to overturn the conviction. "This is as much a punishment for the baby who has done nothing as it is a punishment for the mother and is a wholly disproportionate response to this particular offence."

Yesterday the 17-year-old was meeting with her lawyers to discuss the possibility of appealing to the High Court and supporters - who by now including the author and childbirth guru Sheila Kitzinger - were trying to find a way for the girl to stay with her baby after the birth. With the great and the good on board, the issue became much more than whether a shoplifter should have two weeks shaved off her sentence.

"My view is it is a terrible thing to separate a mother and baby at this point," said Ms Kitzinger, the revered author of numerous books on childbirth. "Pregnancy can be a time for growing up and a time for accepting responsibilities for a child. This takes that chance away from this girl. It will also make it more likely that she will find it difficult to fall in love with her baby and to learn how to respond to its needs." It will also make breast feeding much more difficult. The judge's idea of what constituted a punishment drew her particular wrath. "He's thinking of the baby as a doll that is going to be taken away from a little girl who has been naughty. The man needs basic education about human relationships."

Having read of the story in the the papers Ms Kitzinger tracked down the prison in which the girl was being held. She then rang a doctor friend in Bristol - where the 17-year-old will give birth - and hopes now to contrive it for the new mother to stay in hospital to bond with her baby. "We should think of this as an opportunity. I would like this young woman to feel that there are people who understand her, there are people to cherish her and nurture her so she, in turn, can nurture her baby."

What will the 17-year-old in Eastwood Park make of all this? Judge Gabriel Hutton thought he was doling out a punishment but instead he has created a cause celebre. The sad personal history of one teenager has suddenly become the battle ground on which ideologies have locked horns. One side sees it as a law and order test case; the other will only rejoice if the mother is released before birth.

One wonders whether the most obvious outcome - that the teen-ager would be allowed to be moved to an women's prison with a mother and baby unit - will now satisfy anyone.