BOSTON — A federal judge Tuesday cleared Harvard University of discriminating against Asian American applicants in a ruling that was seen as a major victory for supporters of affirmative action in college admissions across the U.S.

In a closely watched lawsuit that had raised fears about the future of affirmative action, a group called Students for Fair Admissions accused the college of deliberately — and illegally — holding down the number of Asian Americans accepted in order to preserve a certain racial balance on campus.

U.S. District Judge Allison Burroughs, however, ruled that Harvard’s admissions process is “not perfect” but passes constitutional muster. She said there is “no evidence of any racial animus whatsoever” and no evidence that any admission decision was “negatively affected by Asian American identity.”

Her ruling, which came after a three-week trial a year ago, brings temporary relief to other universities that consider race as a way to ensure campus diversity. But it also sets the stage for a prolonged battle that some experts predict will go all the way to the U.S. Supreme Court.

Harvard President Lawrence Bacow welcomed the ruling, saying the consideration of race and other factors “helps us achieve our goal of creating a diverse student body that enriches the education of every student.”

“Today we reaffirm the importance of diversity — and everything it represents to the world,” he said.

Students for Fair Admissions said it will appeal.

“We believe that the documents, emails, data analysis and depositions SFFA presented at trial compellingly revealed Harvard’s systematic discrimination against Asian-American applicants,” Edward Blum, the group’s president, said in a statement.

The American Council on Education, which represents dozens of college and university presidents, said the decision is gratifying against a backdrop of “continuing attacks on what remains the settled law of the land in this area.”

“We applaud this ruling and are confident that the nation’s courts, including its highest court, will continue to uphold the vital principle that colleges and universities that choose to do so can consider race as one factor in reviewing applicants to achieve the goal of a talented, diverse incoming class,” Ted Mitchell, the group’s president, said in a statement.

In the case at Harvard, the plaintiffs argued that Asian Americans were held to a higher standard in admissions, amounting to an “Asian penalty,” while the school gave preference to black and Latino students with poorer grades.

A 2013 internal report at Harvard found that if the school weighed applicants on academics alone, 43% of the admitted class would be Asian American, while in reality it was 19%. Harvard said the report was only meant to be “exploratory” and was based on incomplete data.

The lawsuit centered on a subjective “personal rating” that Harvard assigns to applicants. The suit argued that Asian Americans consistently receive lower personal ratings because of racial bias.

The plaintiffs built their case around a statistical analysis of six years of Harvard admissions data. It found that Asian Americans had the lowest personal ratings and the lowest admission rates, while blacks and Latinos fared far better in both areas.

Harvard countered with its own analysis finding no evidence of bias. During the trial, the dean of admissions offered possible reasons to explain the low personal rating for Asian Americans, saying they may come with weaker letters of recommendation.

The judge sided with Harvard, saying that the plaintiffs’ statistical model “overstates the direct effect of Asian American identity on the personal rating.”