U.S. colleges led by Harvard and Stanford reaped a record $43.6 billion in charitable contributions in the last fiscal year, thanks to booming stock markets.

The richest schools continue to get richer, with less than 1 percent of all colleges accounting for almost 30 percent of the total for the year ended June 30, the Council for Aid to Education, which tracks university giving, said in a survey released Tuesday. The previous record was set a year prior at $41 billion.

Of Maine colleges and universities in the survey, Bowdoin College continued to have the largest endowment with $1.455 billion – an increase of 8.7 percent over 2016 – making it the 69th-largest overall of the 818 U.S. and Canadian institutions in the survey. Other Maine institutions on the list included Colby College (No. 135), Bates College (No. 268), University of Maine Foundation (No. 316), University of New England (No. 685), Husson University (No. 745) and Thomas College (No. 779). See detailed rankings here:

Doug Cook, director of news and media relations for Bowdoin College, said  that the growth of the endowment is critical to the school’s mission.

“Nearly half of Bowdoin’s endowment is restricted by donors for financial aid, permitting us to admit students without regard to their ability to pay and to meet their need for all four years without requiring loans,” he said in a statement Tuesday afternoon.

“It’s a financial aid program that benefits 72 percent of our students from Maine and one that expands as our endowment grows.”

The federal tax overhaul enacted in late December could dampen some future contributions because the increase in the standard deduction eliminates incentives for many taxpayers to give, and the effects may vary state by state.

“You don’t know who’s going to fall into what category,” said Ann Kaplan, the survey’s director. “The details are so complicated, there’s no way to know how that stratification is going to affect any institution. It’s not clear how changes in the law will affect giving.”

Contributions for fiscal 2017 climbed 6.3 percent, fueled by an 18 percent total return for the S&P 500. College endowments gained an average of 12.2 percent on their investments in that span, according to the National Association of College and University Business Managers and Commonfund.

Harvard topped the list for the second straight year with $1.28 billion in contributions, a record for the school, according to survey data. Harvard has raised more than $1 billion annually for the past four years, according to the survey. Stanford followed in fiscal 2017 with $1.13 billion. Stanford had been the No. 1 beneficiary for much of the past decade.

Cornell University ranked third last year with $743.5 million, followed by the Massachusetts Institute of Technology’s $673 million.

Almost 950 schools responded to the survey, which relied on estimates for institutions that didn’t respond.

Foundations were the biggest givers, accounting for about 30 percent of the total, followed by alumni at 26 percent. Alumni giving increased 15 percent in fiscal 2017 after it had dropped 8.5 percent a year earlier. Some alumni accelerated their giving by Dec. 31, before the tax changes took effect.

In addition to increasing the standard deduction, Congress eliminated a tax break for athletic seating. Donors previously could deduct 80 percent of the value of gifts that went to preferred seating at sporting events. Some colleges with major sports programs alerted their alumni of the change and accepted payment for seats for years in advance. On top of that, the richest schools got hit with a new 1.4 percent tax on investment returns.

Still, fundraisers remain optimistic.

An upward trend in giving should continue, as long as schools communicate clearly what the gifts make possible, said Charlie Phlegar, vice president for advancement at Virginia Tech.

“I don’t think people make charitable donations first and foremost based on tax laws,” said Phlegar, who has worked in fundraising for 35 years, including at Cornell and Johns Hopkins universities. “They make it based on their desire to help others.”