(Bloomberg) -- U.S. college endowments posted their strongest performance since 1986 as stocks and alternative investments surged.

The median return before fees was 27% for the 12 months through June, according to data to be published Tuesday by Wilshire Trust Universe Comparison Service. The biggest funds, those with assets of at least $500 million, did even better, with a median gain of 34%.

The investment results, on top of an infusion of federal stimulus funds, are a welcome financial balm for schools that have grappled with revenue declines as the pandemic curtailed enrollment.

U.S. stocks were a key driver, with the S&P 500 returning 41%, including reinvested dividends, for the fiscal year ended June 30. Alternative assets, such as venture capital, private-equity funds and hedge funds, also boosted performance.

“Risk-takers were rewarded,” said Robert Waid, managing director at Wilshire Associates. “Endowments are more likely to be bigger risk-takers than other types of plans.”

Still, the one-year gains may not have much of an impact on university budgets. That’s because spending plans are typically determined by longer-term average investment returns of three to five years, said Don Heller, vice president of operations at the University of San Francisco, who studies higher-education finance.

Schools typically need annual gains of at least 7% to keep pace with spending and inflation. The median return for the fiscal year ended June 2020 was 2.9%, and 6% in the preceding period.

The current fiscal year also may not be as robust -- the S&P 500 has returned 2.2% so far -- and the recent upswing in Covid-19 cases is creating fresh uncertainty for some colleges. It also remains unclear how many international students, who often pay full price for tuition, will be allowed to travel to the U.S.

Read more: Scarce Flights, Visa Issues Snarl Students’ Plans to Reach U.S.

“Most universities are going to be very conservative regarding any kind of additional spending in the operating budget in the coming year,” Heller said.

The data released Tuesday didn’t include results for individual endowments. Schools typically begin to release their annual investment results in September.

©2021 Bloomberg L.P.