A High Court judge gave doctors permission to perform a urgent Caesarean section on a mentally-ill woman who has diabetes.
Mr Justice Hayden gave specialists working for the Royal Free London NHS Trust the go-ahead after a five- hour hearing in the Court of Protection in London.
The judge said a decision "compelling" a Caesarean was "draconian" but he had heard evidence that the woman's life might be in danger.
Ruling late last night, he said he had concluded the woman, who is 32 and 32 weeks' pregnant, lacked the mental capacity to make decisions about whether or not to have her baby delivered by Caesarean section.
Trust officials had applied for permission saying doctors thought an urgent Caesarean necessary so that the woman's "unstable mental state" could properly be treated.
One specialist told the judge that the priority was "keeping this woman alive".
He heard that she was thought to be suffering from paranoid schizophrenia and had attempted suicide.
The judge said neither the woman nor the hospital could be identified b ut he said the health authority could and should be named. He said the scrutiny of doctors' conduct could only "serve to reassure public confidence".
The Court of Protection is part of the High Court and analyses issues relating to sick and vulnerable people.
"The decision to compel a Caesarean Section on an incapacitous woman who is mentally and physically ill is an extremely draconian one," said Mr Justice Hayden.
"Doctors do not embark upon this lightly. It occurs extremely rarely. It is one that the lawyers also take very seriously indeed."
The judge added: "I am perfectly satisfied that at the moment (this woman) is not able to make any reasoned evaluation of the advantages and disadvantages of a Caesarean Section."
He said he had also concluded that the woman - who had stopped eating - lacked the capacity to regulate her own diabetic medicine and monitor her own intake of food and water.
But doctors were not given permission to use force or restrain the woman.
Medics thought that the woman could be persuaded to agreed sedation and did not think that force or restraint would be needed, said the judge.
One doctor the court that the woman's physical and mental problems should lessen - and be easier to treat - once the baby was born.
And the doctor it was feared that the woman might have to have to be restrained, so that nutrients could be fed through a drip, if the baby was not delivered.
A specialist said the baby should not be at risk if delivered via Caesarean Section at 32 weeks