MINNEAPOLIS (AP) -- A federal appeals court ruled Wednesday that two Minnesota boys must be allowed to compete on their high schools' dance teams.

Juniors Dmitri Moua and Zachary Greenwald wanted to try out for their schools' dance teams in suburban Minneapolis. But the Minnesota State High School League's bylaws say the teams are for girls only.

The boys sued in July and asked for an injunction to be allowed onto the teams, saying that the rules violate Title IX, the federal law that bars sex discrimination in education programs that receive federal funds. A federal judge denied the request, but the 8th U.S. Circuit Court of Appeals on Wednesday reversed the judge's ruling and remanded the case to the lower court to issue the boys' injunction.

U.S. District Judge Paul Magnuson initially denied the boys' injunction, saying while the boys were harmed by the ban, the damage caused to the MSHSL would be "
extensive, if not irreparable'' in part because the league could fall out of Title IX compliance if they let the boys dance.

But the appeals court cited the 14th Amendment requirement of equal protection under the law.

Judge Michael Melloy wrote that if the injunction is granted, the boys may try out for their schools' competitive dance teams.

"The negative public consequences of such an allowance, if any, will be slight,'' Melloy wrote.

The boys' attorney, Erick Kaardal, told the Star Tribune the competitive dance season is over this year, but the boys will be able to enter next year as seniors.

The boys filed their lawsuit with help from their parents and the Pacific Legal Foundation, which has worked on similar cases with students in other states.

In a statement, Joshua Thompson, senior attorney for the California-based foundation, said the organization is pleased with the appeals court decision.

"Hopefully the League rescinds its discriminatory rule now, and all boys in Minnesota are allowed to dance competitively. If not, we'll continue the fight in court,'' Thompson said.

A spokesman for the MSHSL said the league is referring inquiries to its attorney, who did not immediately respond to a request for comment Wednesday night.

More From AM 1240 WJON