DENVER — The state of Colorado and Jack Phillips, the owner of Masterpiece Cakeshop, have agreed to end all litigation in state and federal court.

Colorado Attorney General Phil Weiser, whose office represents the Colorado Civil Rights Commission, announced Tuesday the commission and Phillips agreed the state would dismiss its administrative action against Phillips and his bakery in exchange for Phillips dismissing his federal case against the state.

Phillips made headlines around the country in 2012 when he refused to make a wedding cake for a same-sex couple, citing his religious beliefs. His case went all the way to the U.S. Supreme Court, which ultimately ruled in his favor.

Then in 2018, the Colorado Civil Rights Commission told Phillips he and his bakery violated the law by refusing to make a cake for Autumn Scardina, a transgender woman celebrating her transition. Phillips sued the state, arguing the commission was doubling down on anti-religious hostility.

The agreement between the state and Phillips does not affect Scardina’s ability to pursue a claim of her own, Weiser’s office said.

“After careful consideration of the facts, both sides agreed it was not in anyone’s best interest to move forward with these cases,” Weiser said. “The larger constitutional issues might well be decided down the road, but these cases will not be the vehicle for resolving them. Equal justice for all will continue to be a core value that we will uphold as we enforce our state’s and nation’s civil rights laws.”

Both Phillips and the state will pay their own court costs and attorneys’ fees related to the two cases, the state said.