Yale University’s $25.4 billion endowment declined in value last year even as it posted an investment gain.

Like many colleges, Yale spent more than it earned in the year through June 30. School endowments contribute annually to student aid, faculty salaries and other costs in their operating budgets.

Spending, which is often determined by three- or five-year averages of investment returns, is coming under increasing pressure as endowments struggle to keep up with historical results. Boards of trustees and investment committees are re-calibrating expectations for performance, said Paul Dimitruk, chairman of Partners Capital, which handles investments for clients including endowments and foundations.

“Many sophisticated investors believe, as we do, that returns are going to be subpar from historical averages for as far out as we can see,” said Dimitruk, who is also on the investment committee at Denison University in Ohio. The value of Denison’s $716 million endowment fell 10 percent.

College endowments had an average investment loss of 1.9 percent in fiscal 2016, according to a survey of 805 schools by the National Association of College and University Business Officers and money manager Commonfund. That’s the worst year since 2009. Yale’s fund value decline of less than 1 percent fared better than the average drop of 3.1 percent for the richest 100 institutions, according to data analyzed by Bloomberg from the Nacubo survey. Yale posted a 3.4 percent investment gain.

Princeton University’s $22.2 billion fund lost 2.5 percent in value and Massachusetts Institute of Technology’s declined 2.2 percent, despite both schools posting 0.8 percent gains, according to data from the schools and the survey. Wake Forest University, Rice University and George Washington University were among the investment gainers that also lost value.

Some schools have decided to spend less annually, including Michigan State University, which saw a 4.3 percent loss in the last fiscal year. School trustees in April voted to cut its spending rate to 4.8 percent from 5 percent for fiscal 2017. Some schools including Duke University, Grinnell College and Pomona College also spent more than they earned in the previous fiscal year.

Endowments increase in size mainly from investment gains and donations, both of which are tax exempt. Some donations are designated for specific purposes such as new buildings which aren’t funded directly from the endowment. Most school funds annually spend 4 percent to 5 percent and aren’t federally mandated to spend a certain amount like foundations.

Schools in the survey reported an average spending rate of 4.3 percent for fiscal 2016, down from 4.6 percent in 2007. They spent 4.2 percent in fiscal 2015.

The wealthiest schools with funds over $1 billion reported spending rates of 4.4 percent, about the same as the previous year. Schools with funds of $25 million or less spent 3.8 percent, down from 4.5 percent the previous year.

About three-quarters of schools in the survey reported spending a larger dollar amount than the previous year.