An Oregon high school student who was suspended over a shirt that touted President Trump’s proposed border wall has agreed to settle his lawsuit after the school agreed to pay $25,000 for his legal fees and have its principal write him an apology.

Addison Barnes, who graduated this year from Liberty High School in Hillsboro, Ore., outside Portland, filed a lawsuit in federal court in May alleging that the school violated his First Amendment rights when it punished him for wearing the shirt to a politics class discussion about immigration. The shirt said “Donald J. Trump Border Wall Construction Co.,” and “The Wall Just Got 10 Feet Taller.”

An assistant principal told Barnes that he needed to cover the shirt because a student and a teacher said it offended them, according to the complaint filed in U.S. district court in Oregon. Barnes was removed from the class and suspended after he refused, though the suspension was later rescinded.

District Judge Michael W. Mosman sided with Barnes and his lawyers in late May, ordering the school to prevent the school district from banning the shirt while the lawsuit was in progress, a sign that the case had merits to succeed.

Hillsboro School District officials said they decided to settle the case to avoid the “cost and disruption” of litigation. The $25,000 will cover Barnes’s legal fees.

“Please accept my apologies for charging you with a suspension,” the school’s principal, Greg Timmons, wrote in his apology to Barnes. “Best wishes to you in the future.”

In one of the most famous cases about student free-speech rights, Tinker vs. Des Moines, which was cited in Barnes’s court complaint, the Supreme Court sided with students who had been suspended after wearing black armbands to protest the Vietnam War, saying, “Students don’t shed their constitutional rights at the school house gates.” It ruled that student speech could not be censored except in instances where it disrupted or interfered with a school’s activities.

“Tinker leaves no doubt that this requires tolerance of ‘controversial’ opinions or ‘unpopular’ viewpoints,” Barnes’s lawyers wrote in the complaint. “School officials may not suppress student speech based on the ‘mere desire to avoid the discomfort and unpleasantness that always accompany an unpopular viewpoint’ or ‘an urgent wish to avoid the controversy which might result from the expression.’”

Hillsboro School District officials defended the school’s decision on Tuesday, saying that they felt the student’s decision to wear the shirt fell into a legal gray area. In a statement, they noted that a third of the high school’s population is Hispanic and said, “Liberty High School administration believed they could reasonably forecast that Mr. Barnes’ shirt might cause other students to feel unsafe and could potentially lead to walkouts, altercations, or other disruptive actions.”

“Therefore, they acted out of an abundance of caution on behalf of their student body to ensure safety and to maintain a secure school environment by requesting that he cover his shirt,” the statement said.

Barnes and his lawyers disagreed.

“We brought the case to police the thought police,” his lawyer Brad Benbrook said in a statement. “The First Amendment does not allow what is going on in too many schools today.”

Barnes made contact with Benbrook’s firm after reading about another case in which the firm was involved, Benbrook said. His firm represented an eighth-grader in Nevada who sued the district after he was disciplined for wearing two gun-related shirts, one of which was an advertisement for a gun store that appeared to depict an assault-style rifle, and another which promoted a gun rights advocacy group and the slogan “Don’t Tread on Me.” That case was also settled after the public school district updated its dress code to allow clothing that promoted weapons and agreed to pay a portion of the boy’s legal fees.

First Amendment issues have taken on new visibility in the Trump era on the campuses of public schools and universities, as questions about the legal lines around acceptable public discourse have become more urgent amid a heated national debate about racially charged rhetoric and policies.

Universities have been criticized by conservatives as security concerns have prevented some far-right figures from speaking on their campuses, while some public school districts were castigated after the Parkland, Fla., high school shooting when officials threatened to suspend students if they took part in peaceful protests, potentially in violation of the students’ rights.

Read more: