The US Supreme Court has narrowly ruled that the race of a child cannot be used to determine where he or she will be sent to school.
Some parents object to having their children taken by bus across town
The decision, one of the most important civil rights rulings in years, may affect millions of children in the US.
The court's conservative majority struck down the voluntary programmes adopted by many schools.
The judges rejected affirmative action plans which aim to ensure racially mixed classrooms.
Such programmes were introduced during the civil rights era as a means of de-segregating the US's racially divided school system.
Although they are no longer compulsory, hundreds of school districts have kept them in place on a voluntary basis.
'Decision to regret'
But the court voted 5-4 against the voluntary programmes of Seattle and Louisville, Kentucky.
The BBC's James Coomarasamy, in Washington, says that in both cases the judges ruled in favour of white parents who had argued their children were unfairly denied entry to the schools of their choice because they would have exceeded a quota of non-black pupils.
In the legal opinion, Justice John Roberts asked: "What do the racial classifications do in these cases if not determine admission to a public school on a racial bias?"
"The way to stop discrimination on the basis of race is to stop discriminating on the basis of race," he added.
But the court's four liberal justices, who voted against the ruling, published a dissent.
"This is a decision that the court and the nation will come to regret," Justice Stephen Breyer wrote.
The liberal judges argued that the decision undermines a landmark 1954 ruling which first outlawed school segregation.