WASHINGTON (Reuters) - A U.S. judge on Tuesday ordered a rural Mississippi school district to comply with a nearly 40-year-old order and halt long-disputed practices that led to racial segregation in its schools.

The Justice Department accused the Walthall County School District in rural Mississippi of annually permitting more than 300 students, most of them white, to transfer to a school outside of their residential area, shifting its racial makeup.

Further, administrators at three other schools grouped most of the white students into their own classrooms “resulting in significant numbers of segregated all-black classrooms at each grade level,” the U.S. government said in a court filing.

The case comes in a state that was at the heart of the U.S. civil rights movement in the 1960s. In 1964, three civil rights workers were murdered in Mississippi, an incident that helped prompt Congress to pass a law banning racial segregation in schools, work and public places.

The school district was ordered in 1970 to stop segregating its schools. But in the late 1980s officials were confronted by the Justice Department with concerns about student transfers to other schools that undermined the desegregation efforts.

While the district made some changes in the early 1990s, the Justice Department said the practices continued and the schools became “significantly more segregated.” The district did not respond to the government’s lawsuit seeking reforms.

In fact, the county school board in 2009 rejected a tentative settlement with the government that would have overhauled the district’s transfer policy and prevented students being assigned to classrooms based on race.

LIMIT TRANSFERS

On Tuesday, U.S. District Judge Tom Lee, in Jackson, Mississippi, ordered the school district to significantly limit transfers. Lee also ordered the district to stop assigning students to classrooms that resulted in segregation, demanding that it use a software program to randomly assign them.

“It is unacceptable for school districts to act in a way that encourages or tolerates the resegregation of public schools,” said Thomas Perez, assistant attorney general of the Justice Department’s Civil Rights Division.

In 2008, the Walthall district had about 2,550 students -- of whom about 64 percent were black and 35 percent were white.

At four schools, less than a quarter of the students were white while at least 73 percent of the students were black in 2008, according to the government court filing. In 1992, the racial makeup of those schools was between 59 percent and 70 percent black and at least 30 percent white.

Meanwhile at another school, Salem Attendance Center, 66 percent of the students were white while a third were black students in 2008. That was a dramatic shift from 1992 when a majority, 58 percent, were black and 42 percent were white.

The change in the school racial makeup was not because of population shifts, but rather “the product of unlawful district transfer policies that permit hundreds of white students” to transfer each year, the Justice Department said.

The superintendent for the district declined to comment on the judge’s ruling.