WASHINGTON — In a narrow victory for affirmative action, the Supreme Court on Thursday upheld a University of Texas program that takes account of race in deciding whom to admit, a decision that was cemented by the death of Justice Antonin Scalia.

The justices' 4-3 decision in favor of the Texas program ends a 2008 lawsuit that included a previous trip to the Supreme Court, filed by Abigail Fisher, a white Texan who was denied admission to the university.

Justice Anthony Kennedy said in his majority opinion that the Texas plan complied with earlier court rulings that allow colleges to consider race in pursuit of diversity on campus.

“The university has thus met its burden of showing that the admissions policy it used was narrowly tailored,” he wrote.

The court's three more-conservative justices dissented, and Justice Samuel Alito read portions of his 51-page dissent. “This is affirmative action gone wild,” he said. The university “relies on a series of unsupported and noxious racial assumptions.”

In a separate dissent, Justice Clarence Thomas repeated his view that the Constitution outlaws any use of race in higher education admissions.

With the death of Scalia in February and with Justice Elena Kagan sitting out the case because she worked on it while serving in the Justice Department, just seven justices participated in the decision.

Scalia, long opposed to affirmative action, was criticized for suggesting at arguments in December that some black students would benefit from being at a “slower-track school,” instead of Texas' flagship campus in Austin.

At the very least, Scalia's vote could have made the result a tie and limited the high court to issuing a one-sentence opinion upholding the lower court ruling in favor of Texas.

In that instance, the result would have been the same but without the Supreme Court endorsement offered by Kennedy on Thursday.

The university considers race among many factors in admitting the last quarter of incoming freshmen classes. The state fills most of its freshman class by guaranteeing admission to students who graduate in the top 10 percent of their Texas high school class.

The high court ruled in the case of Fisher, who contended she was rejected by the university while African-American applicants with lower grades and test scores were admitted.

The school said Fisher, who did not graduate in the top 10 percent of her class, would not have been admitted with or without race as a factor.

Mike Lurie, spokesman for the University System of Maryland, said, “In Maryland, our admissions offices continue to be allowed to use race-conscious admissions to promote diversity, as one factor in its admissions process – so long as race is not the sole determining factor and is, rather, one part of a holistic process in which numerous aspects of a student's admission profile are considered.”