WASHINGTON, D.C. — President Trump’s Justice Department appeared at the Supreme Court on Tuesday to argue that religious business owners are free to discriminate against people — as long as it doesn’t involve race.

The Supreme Court heard arguments on Tuesday about whether a religious Colorado baker can refuse to make a wedding cake for a gay couple. U.S. Solicitor General Noel Francisco, arguing in support of the baker, fielded questions from the justices about where the government would draw the line between discrimination and freedom of speech and religion. The baker should be allowed to turn the gay couple away if he feels making the cake would violate his rights, Francisco argued.

“How about if it’s a question of race?” Justice Ruth Bader Ginsburg asked.

“I think that race is particularly unique,” Francisco said.

“How about gender? How about national origin and religion?” Ginsburg continued.

“I think pretty much everything but race would fall in the same category,” Francisco responded.

The federal government got involved in the case when the Justice Department submitted an amicus brief to the Supreme Court on behalf of Jack Phillips, who owns the Lakewood, Colorado bakery, Masterpiece Cakeshop, and refused to make a wedding cake for Charlie Craig and Dave Mullins in 2012. When the state of Colorado said he violated the state’s anti-discrimination law, he appealed, and the Supreme Court agreed to hear his case, which pits the right to religious freedom against the right not to be discriminated against.

During arguments on Tuesday, several other Supreme Court justices jumped at the similarities between discrimination for sexual orientation — at issue in this case — and race.

The court’s longtime swing vote Anthony Kennedy, for example, questioned whether a win for the baker would let others business owners advertise that they don’t do business with gay couples — alluding to “Whites Only” signs in the segregation era.

Justice Sonia Sotomayor also brought America’s sordid history with interracial marriage.

“The problem is that America’s reaction to mixed marriages and to race didn’t change on its own. It changed because we had public accommodation laws that forced people to do things that many claimed were against their expressive rights and against their religious rights,” she said.

Federal civil rights law prohibits public businesses from discriminating against customers based on their race but not based on sexual orientation. Colorado is one of just 21 states with laws that list sexual orientation as a protected class. Lawyers for the baker want an exemption from Colorado’s anti-discrimination law for religious people who oppose same-sex marriage, and the Justice Department supports their view.