If the test is negative, indicating that the baby is free of the virus, the mother will be urged to stop breast feeding, which carries a one in 10 chance of passing on the infection. In that event, the judge said, social workers would have to rely on persuasion as he did not believe the law could "come between the baby and the breast".
There is a 20-25 per cent chance that the baby is already infected. If the test proves that is the case, doctors will recommend that the baby, aged four months, be monitored for the viral load in its blood. If it should fall ill, treatment with a combination of anti-Aids drugs would be recommended, although these do have side effects.
Without treatment, the child could be expected to survive until it was about five years old, but with treatment it could live to between 15 and 18 years old or longer.
Aids charities were split yesterday on the High Court's decision. The George House Trust, a voluntary organisation working with HIV mothers and children in Manchester, said it would spark a witch-hunt and threatened to drive people with HIV underground.
A spokesman said: "Nobody should be forcibly tested for HIV. Taking people to court to ensure testing risks driving HIV underground, making it less likely that people will use services. This is not in the interests of the public's health."
The National Aids Trust said voluntary testing meant Britain had one of the lowest infection rates in Europe. But it backed the judgment on the basis that it was in the best interests of the child. "This is not a green light for local authorities. Each case has to be decided on its merits. In this case the child was unable to give consent and the benefits of knowing the result [of the test] was borne out by the medical evidence," a spokesman said.
The conflict between the rights of the parents and the interests of the child lay at the centre of the case. In his judgment, Mr Justice Wilson said the father's claim that the couple had rights as parents over their baby was wrong. "This baby has rights of her own," he said.
Andrew Grubb, professor of medical law at the University of Wales in Cardiff, said: "In law parents have no rights over their children, only duties. The culture has changed."
The change was triggered by the 1985 decision of the Law Lords against Victoria Gillick, who asserted that it was her right to decide on the upbringing of her children in preventing doctors from prescribing the contraceptive pill to her daughters under 16 without her consent.
The Law Lords rejected her claim, saying the crucial question was what was in the best interests of the child. That principle was enshrined in the Children Act 1991.
Professor Grubb said a series of similar cases in the UK, many involving Jehovah's Witness parents refusing consent for their children to undergo blood transfusions, had been decided by the courts against the parents. But in other countries, courts were less likely to intervene.
"In the United States, courts take the view that parents know best much further than in the UK. English courts are more interventionist, especially in medical cases. No judge wants to see a child die if they can avoid it," Professor Grubb said.Reuse content