WASHINGTON, June 28  With competing blocs of justices claiming the mantle of Brown v. Board of Education, a bitterly divided Supreme Court declared today that public school systems cannot seek to achieve or maintain integration through measures that take explicit account of a student’s race.

Voting 5 to 4, the court, in an opinion by Chief Justice John G. Roberts Jr., invalidated programs in Seattle and metropolitan Louisville, Ky., that sought to maintain school-by-school diversity by limiting transfers on the basis of race or using race as a “tiebreaker” for admission to particular schools.

Both programs had been upheld by lower federal courts and were similar to plans in place in hundreds of school districts around the country. Chief Justice Roberts said such programs were “directed only to racial balance, pure and simple,” a goal he said was forbidden by the Constitution’s guarantee of equal protection.

“The way to stop discrimination on the basis of race is to stop discriminating on the basis of race,” he said. His side of the debate, the chief justice said, was “more faithful to the heritage of Brown,” the landmark 1954 decision that declared school segregation unconstitutional. “When it comes to using race to assign children to schools, history will be heard,” he said.