WASHINGTON — The U.S. Supreme Court on Monday dealt a partial victory to the owners of an Oregon bakery who were fined for refusing to provide a cake for a lesbian commitment ceremony.

The justices wiped out lower court rulings against the bakers and sent the case back for another round of hearings.

The legal dispute raised the same issues that arose a year ago in the case of a Colorado baker who refused to provide a custom cake to celebrate the wedding of two men. That baker, Jack Phillips of Masterpiece Cake, said it would require him to act against his religious views and violate his right of free speech.

The court failed then to resolve the central issues in his case, ruling instead on narrow grounds unique to him. Religiously affiliated groups were hoping the justices would use the Oregon case to answer the hard questions it avoided last year. But sending the case back to the lower courts, with instructions to reconsider their rulings in light of the Colorado case, gives the lower courts very little to go on.

Boyden Gray, a Washington, D.C., lawyer representing the Oregon bakers, said the Supreme Court should decide whether its 2015 gay marriage ruling "can be wielded as a shield in defense of same-sex unions but also — as in this case — a sword to attack others for adhering to traditional religious beliefs about marriage."

The dispute began in 2013 when Rachel Cryer asked the owners of Sweet Cakes by Melissa in suburban Portland for a cake to celebrate her commitment to another woman. Aaron Klein, who owned the bakery with his wife, Melissa, said creating a custom cake for a same-sex ceremony would violate the couple's religious beliefs. When Cryer's mother later urged him to reconsider, he quoted from the Bible's Book of Leviticus and said same-sex relations were "an abomination."

Cryer and her fiancee, Laurel Bowman, filed a complaint with Oregon's Board of Labor and Industries. It found that the bakery's owners violated a state law forbidding businesses to discriminate against customers on the basis of, among other factors, sexual orientation. State courts upheld the finding and a $135,000 fine against the Kleins.

As Jack Phillips of Masterpiece Cake did, the Kleins argued that their custom cakes are works of art deserving of protection as free expression under the First Amendment. Requiring them to bake a cake for a same-sex wedding, they said, would force them to express a view they oppose.

Similar legal challenges have been brought by business owners who print invitations, shoot still photographs and videos, and arrange flowers but do not wish to provide their services for same-sex ceremonies. A total of 21 states including Oregon and Colorado have public accommodation laws that outlaw discriminating on the basis of sexual orientation.

One issue in the Oregon case, which also came up in last year's Masterpiece Cake case, is whether a cake is a work of art. The bakers said they spend hours designing and constructing their one-of-a-kind cakes. But the Oregon Court of Appeals found that "even when custom-designed for a ceremonial occasion, they are still cakes made to be eaten." It also said people who attend a wedding might consider the cake an expression of the views of the honored couple, not that of the bakers.

The state urged the Supreme Court not to take the case, arguing that the lower courts ruled correctly. "Baking is conduct, not speech," the state said in its court filings. "A bakery open to the public has no right to discriminate against customers on the basis of their sexual orientation."

Requiring businesses to treat their customers equally, regardless of sexual orientation, does not compel support for gay marriage "any more than the law compels support for religion by requiring equal treatment for all faiths," the state said.