A woman with severe learning difficulties should be allowed to make her own choice about whether to continue with her pregnancy, the High Court has ruled.
Concerns were expressed that she lacked the capacity to make the decision.
However, the judge said people who lacked mental capacity in some aspects of their lives could still make "deeply personal decisions".
The woman, who cannot be identified, is 18 weeks pregnant.
She was born with a disease of the blood - sickle cell anaemia. Instead of her red blood cells, which carry oxygen around the body, being disc-shaped they are sickle-shaped.
This increases the chance of blood vessels becoming blocked, which can cause a stroke if it happens in the brain.
The woman, who now lives with her mother and sisters in the south of England, had a series of strokes which left her with learning difficulties.
The court heard she was in the bottom 1% of the population in terms of intellectual function.
She was awarded substantial damages resulting from her medical treatment. However, she was not capable of dealing with the money so two deputies were appointed.
A solicitor acting as the young woman's deputy raised concerns about her capacity to decide whether to continue with her pregnancy.
Psychiatrist Dr Stephen Tyrer told the Court of Protection at the High Court in London, that the woman had the capacity "to decide whether or not to continue with, or terminate, pregnancy".
Mr Justice Hedley said: "It is right to observe that both expert and professional and family evidence in the case is it would be in her best interests to continue with the pregnancy, but that is outwith the jurisdiction of this court."
He said those who were unable to function independently "may very well retain the capacity to make deeply personal decisions about how they conduct their lives".
This included areas such as relationships and whether to continue or terminate a pregnancy.