The European Court of Human Rights has dismissed a legal challenge in a long-running dispute known as the "gay cake" case, ruling the action inadmissible.
The judges said applicant Gareth Lee "failed to exhaust domestic remedies" available to him in the UK courts.
Mr Lee sued a Northern Ireland bakery for refusing to make a cake decorated with the slogan "Support Gay Marriage".
Ashers Bakery, a Christian-run firm, refused the order, saying the slogan contravened their religious beliefs.
Mr Lee, from Belfast, alleged that by refusing to fulfil the order, the bakery had discriminated against him on grounds of his sexual orientation and political beliefs.
He won his original case and a subsequent appeal in the UK courts, but the UK Supreme Court disagreed in 2018 and found in favour of the bakery.
Mr Lee then took his case to the European Court of Human Rights.
On Thursday it ruled his case was inadmissible because he had not invoked his rights under the European Convention of Human Rights "at any point in the domestic proceedings" in the UK courts.
The judges decided that in order for a complaint to be admissible, "the Convention arguments must be raised explicitly or in substance before the domestic authorities".
"The applicant had not invoked his Convention rights at any point in the domestic proceedings.
"By relying solely on domestic law, the applicant had deprived the domestic courts of the opportunity to address any Convention issues raised, instead asking the Court to usurp the role of the domestic courts.
"Because he had failed to exhaust domestic remedies, the application was inadmissible," the ruling said.