A baker who refused to make a wedding cake for a same-sex couple and was told by a judge if he continued to do so he could face fines and worse, has said he would rather go to prison.

The complaint was filed against Jack Phillips, after the couple David Mullins and Charlie Craig, visited the Masterpiece Cakeshop in Denver, Colorado in 2012.

The couple said Mr Phillips said he would not make a cake for them, after he found out they were celebrating their wedding in Colorado, after they got married in Massachusetts.

Judge Robert N Spencer last week ruled that Mr Phillips broke the law in refusing the service, and ordered him to accommodate all customers in future, or face fines and possible further penalties.

Speaking in an interview with Fox News, Mr Phillips has now said: “If [going to prison is] what it takes, I guess I would be. I don’t plan on giving up my religious beliefs. . . . This is who I am, it’s what I believe.”

“I don’t feel that I should participate in their wedding, and when I do a cake, I feel like I’m participating in the ceremony or the event or the celebration that the cake is for.”

In his 13-page ruling, Judge Spencer wrote: “At first blush, it may seem reasonable that a private business should be able to refuse service to anyone it chooses,

“This view, however, fails to take into account the cost to society and the hurt caused to persons who are denied service simply because of who they are.”

Earlier, attorneys arguing on behalf of Mr Phillips said he should not be forced to violate his religious beliefs by making the cake for the couple, while attorneys on behalf of the couple said his faith does not give him the right to discrimination.

“(His) faith, whatever it may have to say about marriage for same-sex couples or the expressive power of a wedding cake, does not give the respondents a license to discriminate,” Amanda Goad, an attorney with the American Civil Liberties Union, told an administrative judge in Colorado’s Civil Rights Commission.

Nicolle Martin, attorney for Mr Philips, said he considers himself ”privileged to design and create the cakes that celebrate the joyous events of people’s lives.

“He believes this is a vocation chosen for him by God, and as a man of God, Jack Phillips lives by certain biblical principles.”

Martin said that Phillips had not decided whether to appeal to a higher court or not.

“If the government can take away your First Amendment rights, there’s nothing they can’t take away from you,” she said.