PHOENIX — The free speech rights of two Christian artists who make wedding invitations were violated by an anti-discrimination ordinance in Phoenix that makes it illegal to refuse service to same-sex couples for religious reasons, the Arizona Supreme Court ruled Monday.

The 4-3 decision reversed lower-court rulings favoring the city.

The state Supreme Court said its ruling is limited to only the creation of custom wedding invitations by Joanna Duka and Breanna Koski and isn't a blanket exemption from the ordinance for all their business operations.

The artists, who believe a marriage should be between only a man and woman, had argued that the ordinance would violate their religious beliefs by forcing them to custom-make products for same-sex marriage ceremonies.

The high court said the city can't force them to make same-sex wedding invitations.

"Duka and Koski's beliefs about same-sex marriage may seem old-fashioned, or even offensive to some," the court majority wrote. "But the guarantees of free speech and freedom of religion are not only for those who are deemed sufficiently enlightened, advanced, or progressive. They are for everyone."

In the dissenting opinion, the court's minority said the case doesn't concern the content of custom wedding products but instead pertains to the identity of customers.

"Today's decision is also deeply troubling because its reasoning cannot be limited to discrimination related to same-sex marriage or based on the beliefs of any one religion, but instead extends more broadly to other claims of a 'right' by businesses to deny services to disfavored customers," the opinion states.

The majority ruling said the city and dissenting justices claimed that if the court were to dare to let the artists express their beliefs, "we, in essence, run the risk of resurrecting the Jim Crow laws of the Old South."

Lawyers for the city are examining potential grounds for an appeal.

Mayor Kate Gallego, a Democrat, emphasized that the ordinance remains in effect.

"I want to be clear: The city of Phoenix does not and will not tolerate hate in any form," Gallego said. "That doesn't change with today's ruling, and we will not stop with our fight."

In 2018, the U.S. Supreme Court sided with a Colorado baker who refused to make a wedding cake for a same-sex couple, finding thst state's civil rights commission showed anti-religious bias when it ruled against the baker for refusing to make the cake.

The Supreme Court decision, however, didn't address the larger issue of whether a business can invoke religious objections to refuse service to gay and lesbian people.

An Arizona state law that bars discrimination by businesses doesn't include sexual orientation as a protected class. Phoenix, Tempe, Flagstaff and Tucson have passed ordinances banning businesses from discriminating on that basis.

So far, Phoenix hasn't taken any enforcement actions stemming from the ban.

A lawyer representing the Arizona artists portrayed the state high court ruling as a sweeping victory, even though the justices limited their ruling to custom wedding invitations.

"Regardless of one's view on marriage, this is a win for all citizens of Arizona, because a government that can crush Joanna and Breanna can crush any one of us" said Jonathan Scruggs, an attorney for Alliance Defending Freedom, a conservative advocacy organization that brought the case.

Scruggs acknowledged the ruling doesn't automatically protect other business owners, who would need to seek their own court order to avoid running afoul of the nondiscrimination ordinances in Phoenix or other Arizona cities.

Jenny Pizer, law and policy director for the LGBTQ-rights group Lambda Legal, which filed a friend-of-the-court brief supporting the city's position, said that the ruling was troubling.

"The court misguidedly has concluded that free speech protections allow businesses to express anti-gay religious views by denying particular custom-design services to customers because of who they are," Pizer said.

Follow NBC Out on Twitter, Facebook & Instagram