A gay clergyman stopped from becoming a hospital chaplain has lost his appeal over a discrimination claim against the Church of England.
Canon Jeremy Pemberton was prevented from officiating after marrying his partner in 2014.
He accused the Church of breaching the 2010 Equality Act, but lost an appeal against an employment tribunal in 2016.
The Court of Appeal, which heard Mr Pemberton's case in January, has also now dismissed his case.
In a statement, Mr Pemberton said: "The Church of England has established through this process that it can continue to discriminate legally against some LGBT people in relation to their employment, even where that employment is not within the boundaries of the church's jurisdiction.
"This will seem to most people in the UK today an extraordinary result, and not one that will help commend the claims of Christ to the nation."
The Diocese of Southwell and Nottingham said it was "pleased" the court upheld the decision.
Mr Pemberton had been working as a chaplain in a Lincolnshire hospital when an offer to work as a bereavement manager at Sherwood Forest Hospitals NHS Trust was withdrawn when his licence was revoked.
He claimed the Right Reverend Richard Inwood, then the acting Bishop of Southwell and Nottingham, discriminated against him because of his homosexuality, but the bishop argued it was same-sex marriage that went against the church's beliefs.
No further appeal
In January Sean Jones QC, representing Mr Pemberton, told the court the bishop's decisions were wrong because the Church of England does not have a fixed rule on same-sex marriage among members of the clergy.
He argued members in civil partnerships that are "effectively indistinguishable" from marriage were allowed to continue practising.
But Thomas Linden QC, in documents submitted to the court, said Mr Pemberton had "publicly flouted" the Church's position on marriage.
Mr Pemberton said he had agreed he would not appeal further and the church would not pursue him for legal costs.