A Manhattan judge has tossed out a case alleging that a Philadelphia man was kicked out of a New York City bar for wearing a "Make America Great Again" hat.

Manhattan Supreme Court Justice David Cohen ruled Wednesday that the law doesn't protect against political discrimination and dismissed the case, the New York Post reported.

Greg Piatek, a 31-year-old accountant who lives in Center City, visited New York's 9/11 Memorial Museum with friends in January 2017, donning his "Make America Great Again" hat, "a garb which holds significant spiritual and symbolic" importance to him, according to court records.

He and his friends then went to the Happiest Hour, a bar in New York's West Village, where Piatek alleges that the bartender ignored him while he was waiting to order a drink. A confrontation ensued, and the bar's bouncers escorted the group from the building.

"Piatek did not wear the hat to espouse support for a political candidate or point of [view]," reads a court filing from attorney Paul Liggieri, who represents Piatek. "Rather, it is Plaintiff's [sincere] belief that the hat is representative of a set of closely held spiritual [aspirations] and convictions that entirely transcend the political realm."

Cohen heard about an hour of arguments before making his ruling Wednesday, according to the Post. Attorney Elizabeth Conway, who represented the Happiest Hour in the case, contended that while religious discrimination is protected under the law, supporting President Trump is "not a religion."

"Here the claim that plaintiff was not served and eventually escorted out of the bar because of his perceived support for President Trump is not outrageous conduct," the judge ruled, according to the Post.

Liggieri intends to review the court's decision before deciding whether to appeal.