The UK's highest court has overturned a ruling made in favour of two Catholic midwives who object to any involvement in abortion procedures.

Five justices at the Supreme Court in London allowed an appeal by NHS Greater Glasgow and Clyde against a decision of the Court of Session in Edinburgh last year in the case of Mary Doogan and Connie Wood.

As conscientious objectors, the senior midwifery sisters have had no direct role in pregnancy terminations, but they claim they should also be entitled to refuse to delegate, supervise and support staff involved in the procedures or providing care to patients during the process.

Court of Session judges ruled that the right of conscientious objection "extends not only to the actual medical or surgical termination but to the whole process of treatment given for that purpose".

But the health board argued that conscientious objection is a right only to refuse to take part in activities that directly bring about the termination of a pregnancy.

Lady Hale, Lord Wilson, Lord Reed, Lord Hughes and Lord Hodge unanimously allowed the appeal today.

The case before the justices centred on the scope of the right to conscientious objection under the Abortion Act 1967, which provides that "no person shall be under any duty ... to participate in any treatment authorised by this Act to which he has a conscientious objection".

The Royal College of Midwives (RCM) and British Pregnancy Advisory Service (bpas) had warned of the implications for services if the Court of Session decision was allowed to stand.

Last April's appeal victory for the two women followed a ruling against them in 2012 in their action against NHS Greater Glasgow and Clyde.

In the previous appeal ruling in favour of the women, Lady Dorrian, with Lords Mackay and McEwan, said: "In our view, the right of conscientious objection extends not only to the actual medical or surgical termination but to the whole process of treatment given for that purpose."

After that decision, Ms Doogan and Ms Wood said the ruling affirmed the rights of all midwives to withdraw from a practice that would ''violate their conscience''.

The women were employed as labour ward co-ordinators at Southern General Hospital in Glasgow. At the time of the original ruling, Ms Doogan had been absent from work due to ill health since March 2010 and Ms Wood had been transferred to other work.

Both registered their conscientious objection to participation in pregnancy terminations years ago, under the Abortion Act, but became concerned when medical terminations were moved to the labour ward in 2007.

They said being called upon to supervise and support staff providing care to women having an abortion would amount to ''participation in treatment'' and would breach their rights under the European Convention on Human Rights.

In the original ruling against them, the judge, Lady Smith, found that the women were sufficiently removed from involvement in pregnancy terminations to afford them appropriate respect for their beliefs.

The "landmark" ruling was welcomed by the RCM and bpas.

In a statement the two bodies said they intervened in the case because they believed "such a broad and unprecedented interpretation of conscientious objection, applicable across the UK, would effectively have enabled a tiny number of staff opposed to abortion to make women's care undeliverable in many NHS settings".

Ann Furedi, chief executive of bpas, said: "We welcome this ruling. bpas supports the right to refuse to work in abortion care, not least because women deserve better than being treated by those who object to their choice.

"But the law as it stands already provides healthcare workers with these protections.

"Extending this protection to tasks not directly related to the abortion would be to the detriment of women needing to end a pregnancy and the healthcare staff committed to providing that care.

"There are enough barriers in the way of women who need an abortion without further obstacles being thrown in their way."

Gillian Smith, RCM director for Scotland, said: "This ruling is sensible and both women and midwives will welcome it.

"The ruling gives extensive definition to complex clinical and other situations, in regard to whether conscientious objection applies or not.

"Midwives and other clinicians will benefit from this ruling's clarity and women will be able to continue to exercise their choice over their reproductive rights."

Announcing the Supreme Court's decision, deputy president Lady Hale said of Ms Doogan and Ms Wood, who are both in their fifties: "Both are practising Roman Catholics who believe that human life is sacred from the moment of conception and that termination of pregnancy is a grave offence against human life.

"They also believe that any involvement in the process of termination renders them accomplices to and culpable for that grave offence."

The case was about the "precise scope" of the right of conscientious objection to taking part in abortion.

The only question for the court was one of "pure statutory construction" - the meaning of the words "to participate in any treatment authorised by this Act to which he has a conscientious objection".

Lady Hale said that "participate" in her view meant taking part in a "hands-on capacity".

Lady Hale said the court's decision on the meaning of the conscience clause "will then set a limit to what an employer may lawfully require of his employees".

She added: "But a state employer has also to respect his employees' (European) Convention rights. And the Equality Act 2010 requires that any employer refrain from direct or unjustified indirect discrimination against his employees on the ground of their religion or belief.

"So, even if not protected by the conscience clause in section 4, the petitioners (Ms Doogan and Ms Wood) may still claim that, either under the Human Rights Act or under the Equality Act, their employers should have made reasonable adjustments to the requirements of the job in order to cater for their religious beliefs."

Those issues were better suited to resolution in proceedings brought by the two women in the employment tribunal.

Lady Hale said it was also not for the Supreme Court to "speculate upon the broader consequences of taking a wide or narrow view of the meaning of section 4".

On the one hand the RCM and bpas "have argued that to give a broad scope to the right of conscientious objection will put at risk the provision of a safe and accessible abortion service available to all pregnant women who need and want it".

On the other hand Ms Doogan and Ms Wood "argue that to adopt a narrow interpretation of their right of conscientious objection will unreasonably restrict, not only what they say is a fundamental right, but also the job opportunities which will be available to them".

Lady Hale said: "Both sides, in other words, argue that adopting a wide or a narrow interpretation of section 4 will restrict the job opportunities of qualified midwives and other health care professionals and workers and in doing so may put at risk the accessibility of the service."

She added: "We do not have the evidence with which to resolve those arguments."

The court's only "safe course" was to make the "best sense we can of what the section actually says".

She agreed with the health authority that the course of treatment to which the two women may object "is the whole course of medical treatment bringing about the termination of the pregnancy".

A "narrow meaning" of the section would restrict it to "actually performing the tasks involved in the course of treatment".

She said: "In my view the narrow meaning is more likely to have been in the contemplation of Parliament when the Act was passed."

It was unlikely that in enacting the conscience clause Parliament had in mind "the host of ancillary, administrative and managerial tasks" that might be associated with acts made lawful under the Abortion Act.

National Secular Society executive director Keith Porteous Wood said: "This vital ruling clarifies the limits of conscientious objection in abortion treatment.

"Had the case gone the other way, it might have opened the way for the broadening of conscience clauses in many other areas of life - much to the detriment of those who don't share the religious or ethical views of those exercising their conscience."