A Manhattan judge is accused of making a federal case out of a field trip.

Sixteen Islamic students from the K-12 Razi School in Woodside, Queens, were barred from entering a courtroom while on a school trip Wednesday because federal Judge Katherine Forrest believed their presence was a ploy by lawyers to influence the jury, The Associated Press reported.

The court drama upstaged the trial itself, in which the federal government is trying to seize a Manhattan skyscraper it says is secretly owned by Iran.

Forrest halted testimony when the 16 students arrived, noting she thought the students’ presence was “gamesmanship” by lawyers.

The judge eventually relented, just in time for the school group to hear one of the lawyers ask if the white scarves worn by 10 students were to blame for the snub. The judge called the comments “so inappropriate that it is breathtaking.”

Sayyed Musawi, one of two social studies teachers who chaperoned the group, called the judge’s initial actions “out of line.”