SALEM, Ore. -- An Oregon high school student disciplined for wearing a "Donald J. Trump Border Wall Construction Co." T-shirt reached a settlement of his lawsuit against the school district, his lawyers said Tuesday. The Hillsboro School District in Portland's western suburbs must pay $25,000 for attorney fees and the principal had to write an apology.

The case highlights the struggle among schools to balance free-speech rights with keeping students safe, as acrimony intensifies over America's immigration policies and enforcement.

"I brought this case to stand up for myself and other students who might be afraid to express their right-of-center views," Addison Barnes, who was a senior at Liberty High School when the incident happened in January, said in a statement sent by his attorneys.

KOIN-TV

In January, Barnes wore the "Donald J. Trump Border Wall Construction Co." T-shirt to a class where a discussion of immigration issues was scheduled. The shirt also said "The wall just got 10 feet taller," a reference to a remark by President Trump.

Get Breaking News Delivered to Your Inbox

According to the lawsuit, a school official summoned Barnes and told him that at least one student and one teacher had been offended by the shirt. Barnes was told to either cover the shirt or go home. Barnes went home, and his absence was listed as a suspension, which was later rescinded, the school district said.

One-third of Liberty's student body is of Hispanic origin and some of their family members have been deported. There have been recent events such as a sit-in to protest immigration policy, and there have also been racially-motivated incidents, the school district said in a statement Tuesday.

"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," the school district said. School administrators "acted out of an abundance of caution on behalf of the student body to ensure safety."

Barnes said his First Amendment rights to free speech had been violated. A federal judge on May 29 issued a temporary restraining order, essentially barring the school from prohibiting Barnes from wearing the shirt, and said the school district had not justified its censorship.

The Benbrook Law Group of Sacramento, California, and Lynch Conger McLane of Bend, Oregon, which announced the settlement, noted that the high school had allowed one of its teachers to hang a sign promoting sanctuary cities that protect immigrants in the United States illegally.

Barnes said he was singled out for supporting Mr. Trump.

"Everyone knows that if a student wears an anti-Trump shirt to school, the teachers won't think twice about it," Barnes said Tuesday. "But when I wore a pro-Trump shirt, I got suspended. That's not right."

Mike McLane, partner with Lynch Conger McLane and a Republican member of the Oregon Legislature, said: "Political speech, whether popular or not, is protected by the Constitution."

"Addison Barnes should be commended for his courage," Brad Benbrook, one of Barnes' attorneys, said in a statement, CBS Portland affiliate KOIN-TV reported. "The message on his shirt wasn't the point of this case. We brought the case to police the thought police. The First Amendment does not allow what is going on in too many schools today."

The school district said Tuesday the incident represents a legal gray area. It cited cases in which federal courts have upheld school bans on speech that would be protected outside public schools, including T-shirts displaying the Confederate flag, the American flag, and the phrase "We are not Criminals" worn by Hispanic students.

The school district said that instead of contesting the lawsuit, which would have been costly and disruptive, it instead compromised.

A letter from Principal Greg Timmons apologizes for the initial suspension charged to Barnes for leaving campus and any upset that may have caused, and wishes him well in the future, the district said.