DENVER — Attorneys for a Colorado baker who refused to make a wedding cake for a gay couple on religious grounds — a stand partially upheld by the U.S. Supreme Court — argued in federal court Tuesday that the state is punishing him again over his refusal to bake a cake celebrating a gender transition.

Lawyers for Jack Phillips, owner of Masterpiece Cakeshop in suburban Denver, are suing to try to stop the state from taking action against him over the new discrimination allegation. They say the state is treating Phillips with hostility because of his Christian faith and pressing a complaint that they call an "obvious setup."

"At this point, he's just a guy who is trying to get back to life. The problem is the state of Colorado won't let him," Jim Campbell, an attorney for the Alliance Defending Freedom, said after the hearing. The conservative Christian nonprofit law firm is representing Phillips.

State officials argued for the case to be dismissed, but the judge said he was inclined to let the case move forward and would issue a written ruling later.

The Colorado Civil Rights Commission said Phillips discriminated against Denver attorney Autumn Scardina because she's transgender. Phillips' shop refused to make a cake last year that was blue on the outside and pink on the inside after Scardina revealed she wanted it to celebrate her transition from male to female.

She asked for the cake on the same day the U.S. Supreme Court announced it would consider Phillips' appeal of the previous commission ruling against him. In that 2012 case, he refused to make a wedding cake for same-sex couple Charlie Craig and Dave Mullins.

The Supreme Court ruled in June that the Colorado commission showed anti-religious bias when it sanctioned Phillips for refusing to make the cake, voting 7-2 that it violated Phillips' First Amendment rights.

But the court did not rule on the larger issue of whether businesses can invoke religious objections to refuse service to gays and lesbians.

Phillips' lawsuit alleges that Colorado violated his First Amendment right to practice his faith and 14th Amendment right to equal protection. It seeks $100,000 in punitive damages from Aubrey Elenis, director of the Colorado Civil Rights Division.

Attorney General Cynthia Coffman says the case should be dismissed because of state efforts to enforce its order against Phillips. A state hearing is scheduled for February to determine what will happen next.

Deputy Attorney General LeeAnn Morrill told Senior Judge Wiley Y. Daniel that the commission did not mention religion in its latest finding against Phillips. She said the commission also has used the state's anti-discrimination law to protect people who have faced bias because of their faith.

The judge said he thought the Supreme Court's ruling had more relevance in the current case than the state acknowledged and quoted from the justices' opinions during the hearing. He mentioned now-retired Justice Anthony Kennedy's conclusion that the commission had shown "hostility" toward religion.

Wiley said he would have to hear evidence before deciding whether to temporarily block state proceedings.

In the lawsuit, Phillips' attorneys say he "believes as a matter of religious conviction that sex — the status of being male or female — is given by God, is biologically determined, is not determined by perceptions or feelings, and cannot be chosen or changed."

It claims Phillips has been harassed and received death threats and that his small shop was vandalized while the wedding cake case made its way through the courts.

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM