A Catholic adoption agency that was warned it could lose its charitable status over its refusal to place children with same-sex couples has won its appeal.

The Office of the Scottish Charity Regulator (OSCR) reviewed the practices of the charity last year after a complaint from the National Secular Society and, in a report, found it was breaking the Equality Act 2010.

It issued a directive to St Margaret's Children and Family Care Society but the Glasgow charity challenged the decision. The watchdog had said the charity discriminated unlawfully and confirmed its earlier decision to issue the direction, giving St Margaret's until April 22 to comply with the Equality Act or it could be removed from the register.

St Margaret's was told that prioritising those who had been married for at least two years discriminated against same-sex couples. But yesterday St Margaret's said it had been successful in its further appeal to keep its charitable status.

In a unanimous ruling, the Scottish Charity Appeal Panel decided in favour of the agency, and overturned the ruling by OSCR that it must lose its status.

A spokesman for St ­Margaret's said: "We are delighted and relieved that the threat hanging over us has been lifted. Our only wish is to continue to do the good work for which we have been recognised by the authorities, of placing children in need of families with loving parents."

Archbishop Philip ­Tartaglia, president of St Margaret's, said: "We are grateful for this wise ­decision. It means that ­families who are ready to adopt can look forward to the future with a little more serenity, and children in great need can be placed into loving homes."

Last year St Margaret's approved 13 adoptive applications and arranged placements for 22 children, slightly more than 10% of the Scottish total.

It gives ­priority to ­prospective parents who are a couple, Catholic, married for at least two years and who wish to adopt within the framework of a Catholic faith, the report said.

St Margaret's is partly funded by the Catholic Church. Its trustees include bishops from dioceses in the west of Scotland.

A spokesman for the ­Scottish Government at the time said it did not believe it was "in anyone's interests to close an organisation that provides such a valuable service to vulnerable children".