LANCASTER, Pa. — Refugee students who accused a central Pennsylvania school district of diverting them into an alternative school have won a court ruling allowing them to attend the regular high school.

U.S. District Judge Edward G. Smith on Friday ordered the School District of Lancaster to enroll the students at Lancaster’s McCaskey High School instead of Phoenix Academy, if they so choose. The plaintiffs said district officials have steered at least 30 students in the past three years to the alternative high school.

Six refugee students aged 17 to 21 who came to the U.S. from Myanmar, Sudan and other war-torn countries sued the district last month over their placement, saying it was “impossible” to learn there because of language barriers. The suit also alleged delayed and denied enrollment.

District officials argued that Phoenix Academy was better suited to older refugee students than the larger and more traditional high school.

The judge also ordered that the district provide instruction to allow the students to become proficient in English and ensure equal access “to the full range of educational opportunities provided to their peers, including curricular and non-curricular programs and activities.”

“The plaintiffs are not seeking the creation of a new entitlement, or new and better schools,” Smith wrote. “The plaintiffs are seeking admittance into a program that currently exists, and that is specifically designed for students with their unique language needs.”

The decision was praised by Vic Walczak, legal director for the American Civil Liberties Union of Pennsylvania, which filed the suit along with the Education Law Center and others.

“Our refugee clients have lived lives of unimaginable hardship, and they are way overdue for a break,” he said.

A spokeswoman said the district will comply with the order.

Many states, including Pennsylvania, allow students to pursue a high school diploma through the school year in which they turn 21.

Civil rights groups have filed at least two similar lawsuits around the country.