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".