FRANKFORT, Ky. — The Kentucky Supreme Court has sided with a print shop owner who refused to make a gay pride T-shirt because he says it was against his religious beliefs.

The state's high court dismissed the claim after two lower courts also ruled in favor of Lexington print shop Hands-On Originals. The company declined a T-shirt order from Lexington's Gay and Lesbian Services Organization for the city's 2012 Gay Pride Festival. The design said "Lexington Pride Festival" on the front.

The high court ruled Thursday that the gay advocacy group lacked standing to make a claim against shop owner Blaine Adamson because the city's gay rights law was written to protect individuals.

"While this result is no doubt disappointing to many interested in this case and its potential outcome, the fact that the wrong party filed the complaint makes the discrimination analysis almost impossible to conduct, including issues related to freedom of expression and religion," the justices wrote in the ruling.

Adamson said after a hearing before the Supreme Court in August that the T-shirt he was asked to print "goes against my conscience."

Lexington's Human Rights Commission ordered Adamson in 2012 to print the shirts and attend diversity training. Adamson appealed and won rulings from the circuit court and state court of appeals. The appeals court said in 2017 the printing business was subject to the city's fairness ordinance but nothing in that ordinance prohibits a private business "from engaging in viewpoint or message censorship."

Follow NBC Out on Twitter, Facebook & Instagram