WASHINGTON, D.C. — A Colorado baker who refused to create a wedding cake to celebrate the wedding of a same-sex couple has gained an ally in the U.S. Justice Department.

In a Sept. 7 brief filed with the U.S. Supreme Court, Acting Solicitor General Jeffrey B. Wall wrote that the government agreed with baker Jack Phillips’ argument that his cakes are a form of expression and that he cannot be compelled to use talents for something that he does not believe in.

“Forcing Phillips to create expression for and participate in a ceremony that violates his sincerely held religious beliefs invades his First Amendment rights,” the brief said.

The Supreme Court will hear arguments in the case in the term that begins this fall.

Wall also maintained that when Phillips declined to make the cake in July 2012 same-sex marriage was not recognized in Colorado.

“In other words, the state itself did not acknowledge the validity of the union it sought to compel petitioners to celebrate,” the brief said. “Especially given that background, the state has not advanced a sufficient state interest to override petitioners’ weighty First Amendment interest in declining to create the expression at issue here.”

The courts ruled in October 2014 that Colorado’s law prohibiting same-sex marriage was invalid and only then did local jurisdictions begin issuing marriage licenses to same-sex couples.

The Colorado Civil Rights Commission and lower courts found that Phillips, owner of Masterpiece Cake in suburban Denver, violated the Colorado Anti-Discrimination Act by refusing to create the cake for Charlie Craig and David Mullins.

Phillips has argued that he does not create cakes for same-sex couples because it would violate his religious beliefs.

The Justice Department’s support of Phillips is the latest in a series of actions the Trump administration has taken to rescind Obama administration positions that favored same-sex rights and introduce new policies on such issues.

Phillips’ case, Masterpiece Cakeshop v. Colorado Civil Rights Commission, is one of several lawsuits in recent years that have focused on the religious freedom of business owners to determine who they can and cannot serve. Other cases have involved photographers, calligraphers, florists and other service-oriented business owners who have said that providing services to same-sex weddings would violate their religious beliefs.

The courts have largely ruled against such arguments, however, determining that businesses serving the public must comply with state anti-discrimination laws.

The Supreme Court declined in 2014 to review a New Mexico Supreme Court case that found that a photographer violated a state civil rights law when she declined to photograph a lesbian couple’s commitment ceremony.

Since then, the court has ruled that marriage is a fundamental right and marriage licenses cannot be denied to same-sex couples nationwide.