Scottish women will still be allowed to take abortion pills at home after a legal challenge against the move was thrown out.
Scotland became the first part of the UK to let women take the drug misoprostol at home last year.
The Society for the Protection of Unborn Children (SPUC) challenged the decision at the Court of Session.
However, judge Lady Wise has now ruled that the Scottish government’s move was “not unlawful”.
SPUC said it was “extremely disappointed” with the decision and that it would appeal against the ruling.
The vast majority of abortions in Scotland take place at less than nine weeks gestation, and are medical rather than surgical procedures.
The medical treatment involves taking two different drugs – first misfepristone, which blocks hormones which maintain the pregnancy, and then misoprostol, which can be taken on the same or following days.
Within an hour of taking the second tablet, women often experience heavy bleeding – usually on the way home from the clinic.
Scottish ministers moved to let women take misoprostol at home, saying this would allow them to be “in control of their treatment and as comfortable as possible during this procedure”.
This already happens in other countries such as France and Sweden, and the British Pregnancy Advisory Service has been lobbying for the law in the UK to be changed.
However, pro-life group SPUC challenged the decision in Scotland’s highest court, arguing that such a move contravenes the 1967 Abortion Act.
It said abortions could only legally be carried out in a medical facility, and argued that allowing women to take the tablet at home could put their health at risk.
However, Lady Wise rejected this, saying: “It seems to me that patients who self-administer medication at home may still be described as being treated by their medical practitioner, who remains in charge of that treatment.”
Drawing an example to diabetics injecting themselves with insulin, she added: “Regardless of place, there is no need for a doctor to hand the medication to the woman personally.”
Dismissing the challenge, the judge wrote: “I have concluded that the decision of the respondents to approve a woman’s home as a place where one stage of the termination of pregnancy can be carried out is not unlawful on either of the grounds contended for by the petitioner.”