Mr Justice Cohen approved treatment plans, agreed by doctors and lawyers representing the woman, after analysing evidence at a hearing in the Court of Protection in London.
He said the woman, who is in her 20s, could not be identified but said bosses at the Leeds Teaching Hospitals NHS Trust had responsibility for her care and had begun Court of Protection litigation.
Barrister Claire Watson, who represented hospital bosses, told the judge that the woman had a learning disability and cognitive difficulties resulting from a stroke.
She said the woman was in the late stages of pregnancy. Specialists had diagnosed health problems with the unborn baby.
Doctors thought that the woman’s mental health problems would make it hard for her to follow midwives’ instructions during a natural birth.
Everyone involved in her treatment was sure that a caesarean section under general anaesthetic was the right option.
Barrister Sophia Roper represented the woman and had taken instructions from staff at the office of the Official Solicitor, who offer help to people who lack the mental capacity to make decisions.
She said the Official Solicitor’s staff had agreed that a caesarean section under general anaesthetic would be best for the woman and child.
Mr Justice Cohen, who is based in the Family Division of the High Court in London, was told that the woman’s partner had not objected to treatment proposals.