CAMBRIDGE, Mass. (AP) — Harvard University announced Wednesday it will turn down $8.7 million in federal coronavirus relief, a day after President Donald Trump criticized the wealthy Ivy League school over taxpayer money it stood to receive.

It followed similar actions at Stanford and Princeton universities, which said they will too will reject millions of dollars in federal funding amid growing scrutiny on wealthy colleges.

Officials at Harvard said the school still faces “significant financial challenges” due to the pandemic but will refuse the money over concerns that “intense focus by politicians” will undermine the relief program created by Congress.

“While we understand any reallocation of these resources is a matter for the Department of Education, we hope that special consideration will be given to Massachusetts institutions that are struggling to serve their communities and meet the needs of their students through these difficult and challenging times,” Harvard said in a statement.

Congress offered $14 billion to the nation’s colleges and universities as part of a $2.2 trillion rescue package. Schools were allotted varying sums based on their size and the number of students they teach from poorer backgrounds.

But Trump said Tuesday that Harvard “shouldn’t be taking” its share because it has such deep financial reserves. It echoed concerns from other critics, including some alumni, who said Harvard doesn’t need the money and can rely on its nearly $40 billion endowment.

WATCH: Stories from Americans struggling with the pandemic’s economic fallout

Education Secretary Betsy DeVos on Wednesday said other rich schools should reject the funding. Affluent schools that do not primarily serve low-income students “do not need or deserve additional taxpayer funds,” she said in a statement.

“Schools with large endowments should not apply for funds so more can be given to students who need support the most. It’s also important for Congress to change the law to make sure no more taxpayer funds go to elite, wealthy institutions,” she said.

The higher education funding was meant to help colleges and students facing financial losses triggered by the pandemic. If colleges accept the funding, they’re required to spend at least half on direct grants for students. Harvard had previously committed to spending its entire share on students, and on Wednesday said it is “fully committed to providing the financial support that it has promised to its students.”

Stanford, which has an endowment of nearly $28 billion, said it told the Education Department on Monday it would refuse $7.4 million allocated in the package. The school said it wanted to free the funding to be directed to smaller colleges that now face an “existential threat” because of the pandemic. Stanford says it’s still “fully committed” to providing financial relief to students.

Officials at Princeton said they will reject $2.4 million in aid, but not because of the pressure from DeVos. The school said it made the decision after the Education Department issued new guidelines forbidding the funding from going to students in the federal Deferred Action for Childhood Arrivals program for immigrants who were brought to the country illegally. The school, which has a $26 billion endowment, said the rules were inconsistent with Princeton’s values.

Harvard also said the “evolving guidance” around the funding factored into its decision.

More than 300 colleges were granted larger shares than Harvard, including some that also rank among the nation’s wealthiest. The University of Southern California, which had an endowment of $5.7 billion last year, was allotted nearly $20 million. Columbia University, with an endowment of $11 billion, was allotted nearly $13 million.

READ MORE: 10 games to help you escape stay-at-home boredom

Major public universities received many of the largest shares, including Arizona State University, which was granted $63.5 million, and the Pennsylvania State University system, with $55 million.

Wealthy colleges are facing new pressure to reject the funding amid a similar outcry over major companies that received emergency aid meant for small businesses. The Shake Shack burger empire said it would return a $10 million loan after facing public anger.

But some of the richest colleges still plan to take the funding. Cornell University, with a $7.3 billion endowment, says it plans to accept $12.8 million in relief and use it entirely on student grants. The University of Notre Dame said Wednesday it also will accept its $5.8 million allotment and direct it all to students. The school’s endowment totals $11.3 billion.

Other affluent universities contacted by The Associated Press, including Duke and Columbia universities, said they have yet to make decisions on the funding.

Scores of colleges say they have taken heavy hits as they refund money to students for housing after campuses closed last month. Many more are losing millions in ticket sales after sports seasons were cut short, and some have lost big shares of their endowments amid swings in the stock market.

Some colleges have starting to furlough employees to avoid deeper layoffs later, and some small colleges have had to shut down permanently amid financial crisis.

Terry Hartle, a senior vice president with the American Council on Education, an association of college presidents, said Congress did not exclude any type of institution when it created the formula used to distribute funding. Instead, lawmakers said all colleges qualified to receive federal education funding were eligible for the relief.

“All schools means all schools: barber colleges, dance schools, community colleges, publicly traded for-profit schools and elite universities,” said Terry Hartle, the group’s senior vice president. “Congress could have but did not exclude any category of institution.”