Mr Justice Hedley said the young woman had the capacity to make her own decision about the pregnancy, and that society could care for the baby if she proved unable to.
The Daily Mail reports that the woman is described as being 'in the bottom one per cent of the UK population in terms of cognitive ability'.
Doctors had said that her life was in danger, and that the termination was 'urgent'.
The woman – whose name has not been released – is 18 weeks into the pregnancy, but suffers from sickle cell disease and has had several strokes.
Her doctors claimed she was unable to make decisions for herself, but the court ruled that she did have the ability to decide on the 'continuation or termination of pregnancy'.
The judge said that his 'instincts are that (her limited mental function) has nothing to do with the issue of whether a pregnancy should continue simply because once the child is born, if the mother doesn't have the ability to care for a child, society has perfectly adequate processes to deal with that'.
"I'm anxious about there being brought into capacity assessments – in relation to this issue – the ability to care for a child in the future," he said.
More:Advice And Health
Suggested For You
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements. Learn more