SAN FRANCISCO (AP) — A Northern California high school’s decision to order students wearing American flag T-shirts to turn the garments inside out during a celebration of the holiday Cinco de Mayo was appropriate, a federal appeals court ruled Thursday.

The 9th U.S. Circuit Court of Appeals said the school officials’ concerns of racial violence outweighed students’ freedom of expression rights. Administrators feared the American-flag shirts would enflame the passions of Latino students celebrating the Mexican holiday. Live Oak High School, in the San Jose suburb of Morgan Hill, had a history of problems between white and Latino students on that day.

The unanimous three-judge panel said past problems gave school officials sufficient and justifiable reasons for their actions. The court said schools have wide latitude in curbing certain civil rights to ensure campus safety.

“Our role is not to second-guess the decision to have a Cinco de Mayo celebration or the precautions put in place to avoid violence,” Judge M. Margaret McKeown wrote for the panel. The past events “made it reasonable for school officials to proceed as though the threat of a potentially violent disturbance was real,” she wrote.

The case garnered national attention as many expressed outrage that students were barred from wearing patriotic clothing. The Ann Arbor, Mich.-based American Freedom Law Center, a politically conservative legal aid foundation, and other similar organizations took up the students’ case and sued the high school and the school district.

William Becker, one of the lawyers representing the students, said he plans to ask a special 11-judge panel of the appeals court to rehear the case. Becker said he would appeal to the U.S. Supreme Court if he loses again.

“The 9th Circuit upheld the rights of Mexican students celebrating a holiday of another country over U.S. student proudly supporting this country,” Becker said.

Cinco de Mayo marks the Battle of Puebla on May 5, 1862, when Mexican troops defeated a French army of Napoleon III, then considered the mightiest military in the world. It is considered a bigger holiday in the U.S., celebrating Mexican heritage with parades and revelry in many major cities.

Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.