President Donald Trump retweeted three anti-Muslim videos last week, just as two appeals courts prepared to hear arguments on challenges to the latest version of his travel ban.

The tweets were bound to come up in court — and they did in a big way Friday, when the U.S. Court of Appeals for the 4th Circuit grilled a Justice Department attorney on whether the tweets taint the restrictions on immigration from eight countries, including six that are majority-Muslim.

Trump drew criticism from lawmakers from Capitol Hill to London for retweeting three videos on Nov. 29 supposedly showing Muslims smashing a statue of the Virgin Mary and assaulting people. The videos were initially posted by anti-Muslim group Britain First.

It’s the same kind of presidential statement the 4th Circuit cited in May when judges blocked a previous version of the travel ban for likely being unconstitutional in how it treated Muslims.

The Trump administration contends its latest travel ban, issued in September, should not be blocked because the restrictions are based on an extensive review of compliance with U.S. immigration vetting standards for national security reasons — and not based on anti-Muslim bias.

But Judge James A. Wynn Jr. was among several judges who tried to get his head around how Trump could tweet anti-Muslim videos and then expect courts to base a decision only on the official language of the ban.

“What do we do with that? Do we just ignore reality and look at the legality to determine how to handle this case?” Wynn asked.

Judge Pamela A. Harris said people can interpret tweets differently. But some of the statements on Twitter from the president on Nov. 29, “even with deference, construing them in the light most favorable to the president, it’s tricky to see the national security rationale in those.”

Judge Stephanie D. Thacker pointed to another tweet from August, when Trump posted, “Study what General Pershing of the United States did to terrorists when caught. There was no more Radical Islamic Terror for 35 years!”

That tweet was insinuating “that shooting Muslims with bullets dipped in pig’s blood should be used to deter future terrorism,” Thacker said. “How am I to take that charitably?”

Still, the Trump administration has the upper hand in the court battle at this time. The two appeals courts that heard arguments this week in separate cases, the 4th Circuit and the 9th Circuit, are expected to quickly issue rulings on the legality of the latest ban on travelers from Chad, Iran, Libya, North Korea, Somalia, Syria, Venezuela and Yemen.

But the Supreme Court has allowed the Trump administration to fully enforce the latest travel ban, meaning the Trump administration will be able to enforce the restrictions until the legal challenges have been settled — even if that takes another trip to the high court.