Updated at 12:46 p.m. EST

A divided U.S. Supreme Court on Monday ruled for a Colorado baker who refused on religious grounds to make a custom wedding cake for a same-sex couple.

In Masterpiece Cakeshop v. Colorado Civil Rights Commission, the 7-2 majority, led by Justice Anthony Kennedy, said the state commission's order that baker Jack Phillips “cease and desist” discriminating against same-sex couples violated his First Amendment right of free exercise of religion.

Justice Anthony Kennedy

“Whatever the confluence of speech and free exercise principles might be in some cases, the Colorado Civil Rights Commission's consideration of this case was inconsistent with the state's obligation of religious neutrality,” Kennedy wrote. “The reason and motive for the baker's refusal were based on his sincere religious beliefs and convictions.”