WASHINGTON — The Supreme Court on Thursday rejected racial integration plans in two major public school districts in Kentucky and Washington, but it left the door open for the limited use of race to achieve diversity in schools.

The decision on how students are assigned to schools in Louisville, Ky., and Seattle could imperil similar plans in hundreds of districts nationwide. Berkeley, for example, uses race as one of many factors to determine school placements.

It was not clear Thursday how the ruling will affect the Berkeley Unified School District, which is involved in a lawsuit claiming it violated a 1996 state law prohibiting racial preferences in public education.

But Maya Harris, executive director of the ACLU of Northern California, said she believed Berkeley's policies — which have been challenged in court at least twice — would stand up to legal scrutiny, even under a more restrictive framework. The Berkeley district aims to ensure its schools reflect the city's population as a whole, rather than its segregated neighborhoods.

"That may very well be a model for other schools that are seeking to provide equal educational opportunities and create a diverse school environment," Harris said.

Berkeley uses race, parent preference, family income, a student's address and other criteria when making campus assignments.

"Based on the early reading of the Supreme Court decision, it appears K-12 education has a strong interest in creating diversity balancing," Superintendent Michele Lawrence said. "Perhaps Berkeley's model will stand the test."

In April, Alameda County Superior Court Judge Winifred Y. Smith ruled that the school district does not violate state law when it considers race as one of many factors in assigning students to schools. The Sacramento-based Pacific Legal Foundation had sued the district, alleging its school assignment policy violates Proposition 209, a 1996 California law prohibiting racial preferences in public education.

Lawrence said that because part of the suit has not been decided in the courts it's still too early to determine how Thursday's ruling might affect Berkeley.

"We do believe we'll be OK because (the district) is involved with diversity balancing and doesn't use one specific race to get the balance," Lawrence said.

In its ruling in April, the Alameda County Superior court judge decided the court needs further evidence before determining the legality of a district program called the Academic Pathways Program, a Berkeley High School college preparatory and tutoring program which is geared toward low-income African American and Latino students, but welcomes students of all races. That part of the suit is still tied up in the courts.

Under Berkeley's diversity balancing plan, each city block in Berkeley is assigned a diversity category based on a formula that considers with equal weight the overall racial composition of the city block, the parent's average education level of the city block, and the average household income.

Berkeley allows students to pick their desired schools, but if a school is over-subscribed students are then assigned schools using a computerized lottery that is weighted by each student's 'diversity score.'

The diversity score is designed to help make sure that the diversity of each school within the school district is proportionate to the diversity of the overall school district. At no point is the race of the individual child used as a criterion for school assignment, district officials said.

The Supreme Court on Thursday split, 5-4, with Chief Justice John Roberts announcing the court's judgment. Its four liberal justices dissented.

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

Yet Justice Anthony Kennedy would not go as far as the other four conservative justices, saying in a concurring opinion that race may be a component of school plans designed to achieve diversity.

To the extent that Roberts' opinion could be interpreted to foreclose the use of race in any circumstance, Kennedy said, "I disagree with that reasoning."

"A district may consider it a compelling interest to achieve a diverse student population," Kennedy said. "Race may be one component of that diversity."

He agreed with Roberts that the plans in Louisville and Seattle violated constitutional guarantees of equal protection.

Justice Stephen Breyer, in a dissent joined by the other liberals on the court, said Roberts' opinion undermined the promise of integrated schools that the court laid out 53 years ago in its landmark decision in Brown v. Board of Education.

"To invalidate the plans under review is to threaten the promise of Brown," Breyer said.

While Roberts said the court was being faithful to the Brown decision, Justice John Paul Stevens in a separate dissent called the chief justice's reliance on Brown to rule against integration "a cruel irony."

Justice Clarence Thomas, the court's only black member, wrote a separate opinion endorsing the ruling and taking issue with the dissenters' view of the Brown case.

"What was wrong in 1954 cannot be right today," Thomas said. "The plans before us base school assignment decisions on students' race. Because `our Constitution is colorblind, and neither knows nor tolerates classes among citizens,' such race-based decision-making is unconstitutional."

The two school systems in Thursday's decisions employ slightly different methods of taking students' race into account when determining which schools they will attend.

Federal appeals courts had upheld both plans after some parents sued. The Bush administration took the parents' side, arguing that racial diversity is a noble goal but can be sought only through race-neutral means.

One of the organizations which has supported the parents, the Sacramento-based Pacific Legal Foundation, has also challenged the Berkeley school district's practices. In October, the public interest legal foundation sued the school district, arguing that Berkeley's school assignment policy violates Proposition 209, a California voter-approved amendment banning racial preferences.

In April, Alameda County Superior Court Judge Winifred Y. Smith ruled the district did not violate state law in its student assignment practices. But she did allow one of the complaints — on a mentoring program for low-income and African-American and Latino students who take Advanced Placement courses — to go forward. That case is still pending.

The Louisville case grew out of complaints from several parents whose children were not allowed to attend the schools of their choice. Crystal Meredith, a white, single mother, sued after the school system turned down a request to transfer her 5-year-old son Joshua Ryan McDonald, to a school closer to home.

Louisville's schools spent 25 years under a court order to eliminate the effects of state-sponsored segregation. After a federal judge freed the Jefferson County, Ky., school board, which encompasses Louisville, from his supervision, the board decided to keep much of the court-ordered plan in place to prevent schools from re-segregating.

The lawyer for the Louisville system called the plan a success story that enjoys broad community support, including among parents of white and black students.

Attorney Teddy Gordon, who argued that the Louisville system's plan was discriminatory, said Thursday, "Clearly, we need better race-neutral alternatives. Instead of spending zillions of dollars around the country to place a black child next to a white child, let's reduce class size. All the schools are equal. We will no longer accept that an African-American majority within a school is unacceptable."

Louisville Mayor Jerry Abramson said he was disappointed with the ruling because Louisville's system had provided "a quality education for all students and broken down racial barriers" for 30 years.

He said he was confident school leaders would come up with effective new guidelines.

The Seattle school district said it used race as one among many factors and relied on it only at the end of a lengthy process in allocating students among the city's high schools. Seattle suspended its program after parents sued.

Kathleen Brose, mother of a white Seattle student who sued the district, said she felt vindicated by the decision. "We've never said we didn't like diversity," Brose said. "We're against discrimination. ... There's just other things they can do without discriminating."

The opinion was the first on the divisive issue since 2003, when a 5-4 ruling upheld the limited consideration of race in college admissions to attain a diverse student body. Since then, Justice Sandra Day O'Connor, who approved of the limited use of race, retired. Her replacement, Justice Samuel Alito was in the majority that struck down the school system plans in Kentucky and Washington.

The cases are Parents Involved in Community Schools v. Seattle School District No. 1, 05-908, and Meredith v. Jefferson County Board of Education, 05-915.

Staff writers Kristin Bender and Katy Murphy contributed to this report