A federal judge on Tuesday ruled against families suing Harvard for allegedly discriminating against Asian American applicants in a blow to activists who hoped to chip away at affirmative action programs.

U.S. District Court Judge Allison D. Burroughs said Harvard had a compelling interest to consider race in admissions because of the benefits of a diverse student body, citing Supreme Court precedent from the 1978 affirmative action case Regents of the University of California v. Bakke. Burroughs said Harvard's program was "not perfect" but ruled that it tread lightly enough in considering race that it could be considered constitutional.

"The Court finds that Harvard’s admissions program 'bears the hallmarks of a narrowly tailored plan,'" she wrote, noting Harvard did not use quotas for race groups, which are prohibited in admissions programs for universities that accept federal funds.

HARVARD SAYS IT RECEIVED $8.9M IN DONATIONS FROM JEFFREY EPSTEIN

"Harvard’s admissions program intends to treat every applicant as an individual," Burroughs wrote. "Harvard does not employ a race-based quota, set aside seats for minority students, or otherwise 'define diversity as ‘some specified percentage of a particular group merely because of its race or ethnic origin.'"

Minority interest groups, including the Asian and Pacific American Labor Alliance and National Association for the Advancement of Colored People Legal Defense Fund, celebrated the result of the case on Twitter.

'"Diversity wins," the APALA's Twitter account said. "This is a win for all working people."

PALESTINIAN HARVARD FRESHMAN, 17, ALLEGEDLY BLOCKED FROM ENTERING US OVER FRIENDS' SOCIAL MEDIA POSTS

The organization representing the plaintiffs, Students for Fair Admissions, said it will appeal the decision.

“Students for Fair Admissions is disappointed that the court has upheld Harvard’s discriminatory admissions policies,” the organization's president, Edward Blum, said in a statement. “We believe that the documents, emails, data analysis and depositions SFFA presented at trial compellingly revealed Harvard’s systematic discrimination against Asian American applicants.”

The plaintiffs were challenging a system that they claimed held Asian American students to a higher standard than African American or Latino students and included a subjective "personal rating," on which Asian Americans consistently received lower marks.

CLICK HERE FOR THE ALL-NEW FOXBUSINESS.COM

Lawrence S. Bacow, the president of Harvard University, also celebrated the ruling, saying a statement: “The consideration of race, alongside many other factors, helps us achieve our goal of creating a diverse student body that enriches the education of every student.”

“Everyone admitted to Harvard College has something unique to offer our community, and today we reaffirm the importance of diversity—and everything it represents to the world,” he said.

The case could make its way up to the Supreme Court, where affirmative action was last examined in 2016. A 4-3 majority ruled in favor of the University of Texas, which involved a lawsuit brought by a white female who was denied admission.

The Associated Press contributed to this report.