WASHINGTON — The Supreme Court on Thursday rejected a challenge to a race-conscious admissions program at the University of Texas at Austin, handing supporters of affirmative action a major victory.

The decision, Fisher v. University of Texas, No. 14-981, concerned an unusual program and contained a warning to other universities that not all affirmative action programs will pass constitutional muster. But the ruling’s basic message was that admissions officials may continue to consider race as one factor among many in ensuring a diverse student body.

The decision, by a 4-to-3 vote, was unexpected. Justice Anthony M. Kennedy, the author of the majority opinion, has long been skeptical of race-sensitive programs and had never before voted to uphold an affirmative action plan. He dissented in the last major affirmative action case.

Supporters of affirmative action hailed the decision as a landmark.

“No decision since Brown v. Board of Education has been as important as Fisher will prove to be in the long history of racial inclusion and educational diversity,” said Laurence H. Tribe, a law professor at Harvard, referring to the Supreme Court’s 1954 decision striking down segregated public schools.