A federal appeals court on Thursday upheld a 2019 ruling that Harvard University does not discriminate against Asian Americans in admissions, a victory for the university in an affirmative-action case that could be headed to the Supreme Court.

A two-judge panel of the U.S. Court of Appeals for the First Circuit found that Harvard’s race-conscious admissions process does not violate civil rights law when the university selects an incoming undergraduate class. In its quest for racial and ethnic diversity, the university acknowledges that it sometimes gives academically qualified applicants from underrepresented backgrounds, including African Americans and Latinos, a positive “tip” that can help their chances of admission.

The decision from appellate Judges Jeffrey R. Howard and Sandra L. Lynch was the second straight legal win for Harvard in a lawsuit with major stakes for higher education nationwide. Students for Fair Admissions, a group opposed to the use of race in admissions decisions, sued the university in 2014 in an effort to halt what it alleged was unlawful discrimination.

The case went to trial in late 2018 after experts from both sides analyzed a huge trove of internal Harvard data spanning several years of applications and admission decisions.

The plaintiff alleged that Harvard engaged in illegal “racial balancing” of its undergraduate classes; relied too heavily on race in making decisions; failed to give adequate consideration to “race-neutral” alternatives; and intentionally discriminated against Asian Americans in ways that benefited applicants from other groups seeking entry to one of the world’s most competitive universities.

U.S. District Judge Allison D. Burroughs ruled in 2019 for Harvard on all counts. The plaintiff appealed soon after in a bid to overturn that ruling.

“The issue before us is whether Harvard’s limited use of race in its admissions process in order to achieve diversity in the period in question is consistent with the requirements of Supreme Court precedent,” Lynch wrote in the appellate court ruling released Thursday that affirmed the trial judge’s decision. “There was no error.”

Judge Juan R. Torruella, who had also been on the panel reviewing the appeal, died last month.

Edward Blum, president of Students for Fair Admissions, said in a statement Thursday: “While we are disappointed with the opinion of the First Circuit Court of Appeals, our hope is not lost. This lawsuit is now on track to go up to the U.S. Supreme Court where we will ask the justices to end these unfair and unconstitutional race-based admissions policies at Harvard and all colleges and universities.”

Harvard, backed by many other colleges and universities and education groups, has denied the plaintiff’s allegations of wrongdoing. The university says it adheres to Supreme Court rulings over decades that have allowed the use of race within certain limits.

“Today’s decision once again finds that Harvard’s admissions policies are consistent with Supreme Court precedent, and lawfully and appropriately pursue Harvard’s efforts to create a diverse campus that promotes learning and encourages mutual respect and understanding in our community,” Harvard spokeswoman Rachael Dane said in a statement. “As we have said time and time again, now is not the time to turn back the clock on diversity and opportunity.”

More than 40,000 applicants sought to enter Harvard’s undergraduate college this fall, and fewer than 5 percent were offered admission. Of those admitted, Harvard said 24.5 percent identified as Asian American, 14.8 percent as African American or Black, 12.7 percent as Latinx and 1.8 percent as Native American.

The legal and political landscapes have shifted markedly in the six years since the Students for Fair Admissions suit was filed.

The Supreme Court in 2016 upheld — within limits — the use of race in admissions at the University of Texas at Austin. It was the latest in a string of rulings on the issue stretching back to the 1970s.

But the court has changed since 2016, with the retirement of Justice Anthony M. Kennedy and the death of Justice Ruth Bader Ginsburg. The court’s new 6-3 conservative majority, cemented with the recent appointment of Justice Amy Coney Barrett to Ginsburg’s seat, could view the long-running controversy over race-conscious admissions in a new light.

Students for Fair Admissions is also challenging the use of race in admissions at the public University of North Carolina at Chapel Hill in a federal lawsuit that went to trial this week. UNC-Chapel Hill is defending its admission practices.

Many universities, public and private, consider race and ethnicity as one factor when choosing a class, part of what they call a “holistic” review of applications. But not all do.

Several states bar public universities from considering race. California voters on Nov. 3 rejected a ballot measure that would have repealed a ban on the use of race in public university admissions and other situations. But the politics of the issue are complex, as this year’s demonstrations for social and racial justice have shown the power of the Black Lives Matter movement.

Thursday’s ruling in the Harvard case was another development in a debate over admissions that has long stirred passions. The appellate court gave a firm endorsement of the university’s argument that racial diversity on campus is crucial to its educational mission.

“Harvard’s interest in student body diversity and its consideration of race to attain it is also not unique,” the ruling said. “Many other colleges and universities consider an applicant’s race, in addition to many other factors, in admissions. And the business community has communicated its interest in having a well-educated, diverse hiring pool both in this case and in the prior governing Supreme Court cases.”

The appellate ruling dismissed the plaintiff’s argument that Harvard gives too much weight to race.

“Harvard has demonstrated that it values all types of diversity, not just racial diversity,” the ruling said. “Harvard’s use of race in admissions is contextual and it does not consider race exclusively.”

The ruling also raised what could become a key question for the Supreme Court: How long should universities be able to consider race?

“Importantly, the evidence is that Harvard has periodically reviewed its use of race in the past, has periodically and recently considered race neutral alternatives, and has made it clear that it will continue to do so in the future,” the ruling said. It added: “No Supreme Court precedent requires Harvard to identify a specific end point for its use of race.”