Scotland’s most senior doctor has been given three weeks to stop allowing women to take the abortion pill at home or face legal action.

Lawyers acting for the Society for the Protection of Unborn Children (SPUC) Scotland have written to Dr Catherine Calderwood, the country’s chief medical officer, with the ultimatum and given her until January 5 to comply.

They claimed the change is “unlawful” as the 1967 Abortion Act lays down specific rules for places where procedures can take place and their legal advice states that it “was not intended to allow abortions to take place at home”.

Specifically, they claimed that the move “is not consistent” with the legislation’s requirement that medical, nursing or clinical staff must be present.

The SPUC said it plans to take court action after receiving a detailed legal opinion from a senior advocate stating the group has “good prospects of success”.

Its threat comes after SNP ministers announced in October that Scotland is the first part of the UK to allow women to take the drug misoprostol outside a clinical setting.

Campaigners arguing for the change said it would save women from multiple trips to clinics, and experiences such as starting symptoms of miscarriage when travelling home. Misoprostol is the second of two tablets administered for a second abortion.