The Department of Justice on Thursday filed a brief in a case pending before the Supreme Court in support of a Colorado baker who refused to serve a gay couple.

In 2012, Jack Phillips, the owner of Denver-based Masterpiece Cakeshop, refused to consider baking a cake for Dave Mullins and Charlie Craig. The men married in Massachusetts and wanted to buy a cake from Phillips for their Denver reception. Phillips said that serving the couple would violate his religious faith. Colorado at the time recognized gay and lesbian couples with civil unions, not marriage.

The couple sued, saying that Phillips' faith does not give him a right to discriminate, and a Colorado court found that Phillips had discriminated against the men under Colorado law. After the Colorado Supreme Court declined to hear an appeal, Phillips turned to the Supreme Court, arguing that the First Amendment protects his religious rights.

In its 41-page amicus brief, the Justice Department sides with Phillips.

“Forcing Phillips to create expression for and participate in a ceremony that violates his sincerely held religious beliefs invades his First Amendment rights in a manner akin to the governmental intrusion in Hurley,” lawyers for the government wrote. “Colorado has not offered, and could not reasonably offer, a sufficient justification for that compulsion here.”

The Justice Department, under the leadership of U.S. Attorney General Jeff Sessions, also argues that sexual orientation discrimination is not on the same footing as discrimination based on race.

“[L]aws targeting race-based discrimination may survive heightened First Amendment scrutiny. … A State's 'fundamental, overriding interest' in eliminating private racial discrimination … may justify even those applications of a public accommodations law that infringe on First Amendment freedoms. The same cannot be said for opposition to same-sex marriage,” the agency wrote.

“The Court has not similarly held that classifications based on sexual orientation are subject to strict scrutiny or that eradicating private individuals’ opposition to same-sex marriage is a uniquely compelling interest. To the contrary, the Court has recognized that opposition to same-sex marriage ‘long has been held – and continues to be held – in good faith by reasonable and sincere people,' and that ‘[m]any who deem same-sex marriage to be wrong reach that conclusion based on decent and honorable religious or philosophical premises.'”

In July, Sessions spoke at the Alliance Defending Freedom's (ADF) Summit on Religious Liberty in Orange County, California, where he told attendees that protecting religious freedom would be a priority under his leadership. ADF is representing Phillips in his case.

(Related: Baker who refused gay couple says Jesus would do the same.)