WASHINGTON (CNN) -- A bitterly divided U.S. Supreme Court on Thursday issued what is likely to be a landmark opinion -- ruling that race cannot be a factor in the assignment of children to public schools.

The court struck down public school choice plans in Seattle, Washington, and Louisville, Kentucky, concluding they relied on an unconstitutional use of racial criteria, with the 5-4 votereflecting the deep legal and social divide over the issue of race and education.

Similar plans already in place or being proposed across the country could be in danger as a result of the ruling, which would sharply limit the power of local governments to achieve diversity using race-based criteria.

A conservative majority led by Chief Justice John Roberts said other means besides race considerations should be used to achieve diversity in schools.

"The way to stop discrimination on the basis of race is to stop discriminating on the basis of race," Roberts wrote.

But supporters of the school choice plans found some hope in Justice Anthony Kennedy's concurring opinion.While finding the two particular plans were unconstitutional, Kennedy said race could still be used in narrow circumstances to ensure integrated schools.

"A district may consider it a compelling interest to achieve a diverse student population," he said.

More than a half-century after the high court outlawed segregation in public schools, the justices were deeply divided over one controversial outgrowth of that decision: What role race should play, if any, in assigning students to competitive spots in elementary and secondary schools.

The cases from Kentucky and Washington revisit past disputes over race and education, stemming from the landmark 1954 Brown v. Board of Education decision.

"Before Brown, schoolchildren were told where they could and could not go to school based on color of their skin. The school districts in these cases have not carried the heavy burden of demonstrating that we should allow this once again -- even for very different reasons," Roberts wrote.

Roberts was joined by Justices Antonin Scalia, Clarence Thomas and Samuel Alito. Kennedy proved the key swing vote in striking down the Louisville and Seattle plans.

Reading his concurring opinion from the bench, the 70-year-old justice said, "This nation has a moral and ethical obligation to fulfill its historic commitment to creating an integrated society that ensures equal opportunity for all its children.

"A compelling interest exists in avoiding racial isolation, an interest that a school district, in its discretion and expertise, may choose to pursue."

But he added, "Crude measures of this sort [as illustrated in this case] threaten to reduce children to racial chits valued and traded according to one school's supply and another's demand."

Thomas took a harder stance against the choice plans: "Simply putting students together under the same roof does not necessarily mean that the students will learn together or even interact," he said. "Furthermore, it is unclear whether increased interracial contact improves racial attitudes and relations."

CNN legal analyst Jeffrey Toobin said the ruling is "going to rank with the great, important school desegregation opinions of the court's history, starting with Brown v. Board of Education in 1954."

"What this court said was even though only a few slots were determined by race, that's too many. You just simply can't consider race in deciding which school kids go to," Toobin said.

"Justice Kennedy, who was the swing vote, said maybe possibly you could do it sometimes. But clearly the message of the court majority here is that race is out as a consideration in school assignments. And a lot of districts still use it and are consideringusing it, and they're going to have to change."

Those on both sides of the issue, as well as the Bush administration, had hoped the Supreme Court would clarify when and to what lengths state and local officials can go to promote diversity in K-12 education.

In a landmark case three years ago, the justices affirmed racial quotas were unconstitutional but offered a limited but powerful endorsement of affirmative action in higher education. The Supreme Court, whose makeup has changed since the first ruling, has now ruled that legal standard does not apply in a K-12 public school setting.

While supporters on both sides of the issue seemed to agree classroom diversity is an important goal, differences remain over how to maintain it without the real or perceived consequence that some families may be unfairly discriminated against or inconvenienced.

In dissent, Justice John Paul Stevens said the majority "reverses course and reaches the wrong conclusion. In doing so, it distorts precedent, it misapplies the relevant constitutional principles, it announces legal rules that will obstruct efforts by state and local governments to deal effectively with the growing resegregation of public schools, it threatens to substitute for present calm a disruptive round of race-related litigation."

Stevens was joined by Justices David Souter, Ruth Bader Ginsburg and Stephen Breyer.

The Seattle and Louisville plans are voluntary, introduced in the years after integration of schools in many areas was managed by the courts. They were not designed as remedial efforts to achieve diversity, but to maintain it, as a reflection of the larger communities' racial makeup.

During oral arguments in December, hundreds of demonstrators -- many of them African-American college students -- marched and chanted outside the court in support of the affirmative action plans. Some carried signs such as "Equal education, not segregation."

Louisville-area schools endured decades of federal court oversight after schools there were slow to integrate. When that oversight ended in the late 1990s, county officials sought to maintain integration, requiring that most public schools have at least 15 percent and no more than 50 percent African-American enrollment. The idea was to reflect the whole of Jefferson County, which is 60 percent white and 38 percent black. Officials say their plan reflects not only the need for diversity but also the desire of parents for greater school choice.

A white parent, Crystal Meredith, sued, saying her child was twice denied the school nearest their home and had to endure a three-hour bus ride to a facility that was not their top choice. Many African-American parents raised similar concerns.

"We are here not because we didn't get our first choice, but because we got no choice," said Meredith shortly after the ruling. "I was told by the school board that my son's education was not as important as their plan. I was told I should sacrifice his learning in order to maintain the status quo."

Louisville school officials said the ruling would not affect their school assignment plan for the coming school year.

"Although the court held that some aspects of the [county's] student assignment plan do not satisfy the court's 'narrow tailoring' requirement, it is clear Justice Kennedy's concurring opinion will allow local boards of education to use certain race-conscious measures to maintain integrity in schools," said Frank Mellon, the attorney representing the school system.

In Seattle, public schools often rely on a "tiebreaker." Under the plan, begun in 1998, families can send their children to any school in their district. When there are more applicants than spaces available, and when a school is not considered "racially balanced," race is one of several "integration tiebreakers" used to achieve diversity.

A group primarily of white parents from two neighborhoods sued in 2001, saying about 200 students were not admitted to the schools of their choice, preventing many from attending facilities nearest to their homes.

One school at the center of the controversy is Franklin High. Half of its roughly 1,500 students are Asian-American, a third are African-American, and about 7 percent are Hispanic. White enrollment dropped from 23 percent in 2000 to 10 percent last year.

The Seattle diversity plan was suspended while the appeals worked their way through the courts.

From the justices' comments during oral arguments and in the various written opinions, it was clear the legal sticking point was whether those diversity efforts represented a "compelling government interest."

The Bush administration supported the parents bringing suit against the choice plans. Solicitor General Paul Clement told the justices the two plans at issue represented "very stark racial quotas." He argued they were a "clear effort to get the schools to mimic the overall community" and that other "race-neutral" means to achieve classroom diversity should be used.E-mail to a friend