Colorado officials and the baker who refused to make a cake for a transgender woman have reached an agreement to end litigation over his refusal.

Jack Phillips, the owner of Masterpiece Cakeshop in Lakewood, Colorado, last year refused to make a cake with a blue exterior and a pink interior to mark Autumn Scardina's birthday and the seventh anniversary of her gender transition.

Phillips' lawyers have said that he refused to make the cake because he believes that gender is “given by God” and “not determined by perceptions or feelings.”

As part of the agreement, the Colorado Civil Rights Commission will voluntarily withdraw its administrative action against Phillips. Phillips, in turn, will voluntarily withdraw his federal court case against the state. In his lawsuit, Phillips accused the state of waging a “crusade to crush” him and his business.

Colorado Attorney General Phil Weiser, a Democrat, announced the agreement in a statement.

“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.”

Last year, the Supreme Court handed Phillips a narrow victory in a similar case involving a male gay couple. Phillips in 2012 refused to make a cake for the couple's Denver wedding reception. The justices said that the state's Civil Rights Commission had shown hostility toward Phillips' religious beliefs and remanded the case to a lower court. The high court left Colorado's law untouched.

Scardina asked Phillips to make her cake on the same day the Supreme Court announced it would hear Phillips' appeal in the 2012 case. Within weeks, the commission found probable cause that Phillips had discriminated against Scardina. Phillips, in turn, filed his own federal lawsuit against the state alleging harassment.

Phillips was represented in both cases by the Alliance Defending Freedom (ADF), a group opposed to LGBT rights.

“We hope that the state is done going along with obvious efforts to harass Jack,” ADF attorney Jim Campbell said. “He shouldn't be driven out of business just because some people disagree with his religious beliefs and his desire to live consistently with them.”

Weiser said that the agreement does not affect the ability of Scardina, an attorney, to pursue a claim of her own.