A devout Christian who was thrown off his university course for posting that homosexuality was a sin has won an appeal against the decision.
Felix Ngole, 39, was removed from a postgraduate social work course at the University of Sheffield in 2016 after posting the Facebook comment.
Judges overturned a previous court ruling and said the university should reconsider Mr Ngole's case.
The university said it was considering its response to the judgement.
Mr Ngole, from Barnsley, had argued that throwing him out breached his rights to freedom of speech and thought.
He said he had been expressing a traditional Christian view that "the Bible and God identify homosexuality as a sin".
His comments were made during a debate on Facebook about Kim Davis, a state official in the US state of Kentucky, who refused to register same-sex marriages, judges heard.
Some months later, he was anonymously reported to the university and was disciplined in a fitness to practice (FtP) hearing.
The university said he was taking a "professionally qualifying degree" with the aim of becoming a social worker and argued what he had said would affect gay people he might work with.
Mr Ngole took his case to the High Court in 2017 but judge Rowena Collins Rice ruled that university bosses had acted within the law.
At his appeal hearing, judges ruled in his favour, stating that "the disciplinary proceedings were flawed and unfair" and said Mr Ngole's case should be heard by another FtP hearing.
Mr Ngole said: "As Christians we are called to serve others and to care for everyone, yet publicly and privately we must also be free to express our beliefs and what the bible says without fear of losing our livelihoods."
A university spokesperson said it supported the rights of students to "hold and debate a wide range of views and beliefs".
"However, for students studying on courses that lead to professional registration, we have a responsibility to look at how any concerns raised could impact a student's fitness to practise once registered."