In a case that pits individual rights against kids' safety, the California Ninth Circuit Court of Appeals ruled on Thursday that it was appropriate for school officials to ban students at Live Oak High School outside of San Jose from wearing American flag t-shirts on Cinco De Mayo. The May 5th holiday, popular in the United States but largely unrecognized in Mexico, commemorates the 1862 battle of Puebla and celebrates Mexican culture, heritage, and pride. The school has a history of racial tension and gang violence.

More on Yahoo: School Officials Deeply Troubled about Guns Appearing on Signs Banning Guns

The ruling stems from a controversial incident in 2010, when five students were told by school administrators to either turn their American Flag t-shirts inside out or go home. In a unanimous decision, the court cited two instances where students had been threatened with violence for wearing the flag. In 2009, Mexican students told an assistant principal they would "f**k up" other kids who were chanting "USA" around a flag they had hung from a tree on the school campus. The next year, students wearing the flag shirts were warned by text messages and phone calls that gang members would come to the school and beat them up. Because only shirts with the American flag were targeted, school officials didn't ban shirts bearing images of other country's flags, including the Mexican flag. After the ban, a group of parents sued the district as a violation of the teens' First Amendment rights. The school district has not responded to Yahoo Shine's request for comment.

More on Yahoo: Healthy Kids: White House Proposes School Ban on Ads for Junk Food

The court pointed out that under previous law, it is legal to restrict high school student's free speech because of safety concerns. The Live Oak dress code also states that, "The school has the right to request that any student dressing inappropriately for school will change into other clothes, be sent home to change, and/or be subject to disciplinary action." Writing for the panel of three judges, 9th Circuit Judge M. Margaret McKeown stated, "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, [the events] made it reasonable for school officials to proceed as though the threat of a potentially violent disturbance was real." However, some parents are threatening to take the case all the way to the Supreme Court. "This is the United States of America," Kendall Jones, whose son was students banned from wearing the t-shirt told the San Jose Mercury News. "The idea that it's offensive to wear patriotic clothing…regardless of what day it is, is unconscionable to me."

Story continues

School clothing bans have become common across the United States. Administrators have cracked down on everything from leggings to NRA t-shirts to UGGS. Last year, a Michigan school told middle-schoolers who were wearing a t-shirt memorialzing a friend who died from leukemia to go home (administrators later apologized and reversed their decision). The American flag t-shirt case is particularly controversial and has strong supporters on both sides of the issue.

The court ruling appears to be on firm ground because of legal precedent, but blogging about the case, Eugene Volokh, a professor of law at UCLA and specialist in free speech, says its about far more than t-shirts and there are some serious issues at stake. "This is a classic "heckler's veto" -thugs threatening to attack the speaker, and government officials suppressing the speech to prevent such violence," he wrote. "The school taught its students a simple lesson: If you dislike speech and want it suppressed, then you can get what you want by threatening violence against the speakers." However, after the decision, school district superintendent, Steve Betando said he felt "relieved." From his perspective from the trenches of a challenged school, the court gave administrators the power to avert any potential harm to students.

More on Yahoo:

Dreadlocks Could Cost California Prison Guard His Job

Russia Moves to Ban Child Beauty Pagents: Why America Should be Next

TSA Officer Accused of Shaming Teen for Wearing Leggings