Environmentalists have pushed universities, museums and other nonprofits to divest their massive endowment funds from fossil fuels, a challenge some have resisted and many have embraced.

Student groups have protested on campuses across the country, including Harvard, Columbia and New York University. Hundreds of institutions like Chicago's Field Museum have pledged in the past several years to rid themselves of all coal, oil and gas holdings.

But even among large institutions dedicated to shedding those investments, the path can be hard. Marcia Marsh, chief operating officer for the World Wildlife Fund in the United States, said, "Nobody has had an easy exit."

An NBC News analysis of the Paradise Papers — a leaked trove of 13.4 million documents from the closed-door world of offshore investing — offers a rare glimpse into sometimes secretive financial entanglements with fossil fuels. That includes stakes still owned by nonprofits that have made public commitments to divestment, like the American Museum of Natural History, the World Wildlife Fund, and the University of Washington.

Take the American Museum of Natural History. The famed Manhattan institution has mounted exhibits on climate change, and its website advises others how to fight global warming. The museum touts itself as a "leader in the public understanding" of a list of scientific issues that includes climate change.

In 2014, it began taking steps to change its investments. The museum no longer owns stock directly in fossil fuel companies. It said in a letter to activists that it seeks fund managers who favor renewable energy, and says it has cut overall investment in fossil fuels in half, from less than 4 percent to less than 2 percent of a massive $617 million endowment.

But that figure doesn't include the museum's investment in fossil fuels through the international private equity firm Denham Capital, according to a document in the Paradise Papers.

The museum pledged $5 million into Denham Commodity Partners Fund V, according to a 2009 document. The fund accepted investors up through the end of May 2008. Roberto Lebron, a museum spokesman, confirmed it still owns a stake in the fund.

The Denham fund has invested in energy projects around the world, including fracking for shale oil in the Ohio and Pennsylvania region. It bid unsuccessfully for Mongolian coal. The fund has also had investments in renewable products like solar, wind and geothermal energy.

"These investments are a small part of our overall program for managing the Museum's endowment," Lebron told NBC News. "The Museum has worked extremely hard to minimize our fossil fuel exposure precisely because it is consistent with our work, including our commitment to educating the public about climate change."

Two years ago, when pressed by the environmental group 350.org on its investments, Daniel Stoddard, the museum's chief investment officer, responded with a letter acknowledging it still had some money invested indirectly through private equity funds in oil and gas. By one measure, the Carbon Underground 200, the museum said it had reduced private equity holdings in fossil fuels to less than 2 percent of its endowment. It is unclear exactly how much that is worth, though it would seem to be less than $12 million, and the museum also declined to say whether those holdings have continued to decline since 2016.

But the Carbon 200 measure tracks only the largest owners of oil and coal reserves around the world. The Denham fund has been financing smaller oil and gas concerns and other related businesses not counted by that list. NBC News compared the Carbon 200 list against Denham purchases reported by Bloomberg and other business news organizations.

The Denham V fund, for instance, put $262 million into MS Directional LLC, a Texas-based company that provides drilling services to the oil and gas industry. And it invested $200 million into Tradition Midstream LLC, which is involved largely in oil and gas pipeline work. Neither is counted by the Carbon 200.

The museum confirmed that Denham was not included in its calculations, but said the investment has diminished in value and is now worth "well below $1 million." The museum said that with the Denham investment added, its holdings in oil and gas would still be less than two percent of the endowment. The museum declined to say whether it had any similar private equity investments in fossil fuels.

Members from the World Wildlife Fund (WWF) light candles during Earth Hour in downtown Malaga, Spain on March 24, 2018. Jesus Merida / SOPA Images - LightRocket via Getty Images

"There's obviously more work to be done," said May Boeve, executive director of 350.org. "We certainly applauded what [the museum] did" so far to divest its holdings, she said. "We encourage the natural history museum and all museums to review the full profile of their investment so that when they do make these commitments they're in line with what they've said."

Professor Michael Mann, director of the Earth System Science Center at Penn State University and author of a leading book on climate change, said the museum's private equity holdings were "troubling." Mann leads a group of hundreds of scientists and others around the country objecting that the New York museum's trustees include Rebekah Mercer, a wealthy financier of conservative causes that challenge the scientific consensus that fossil fuels are a key reason for global warming.

"[The museum does] so much good work. It's so frustrating that there is this other side to them," he said when told of the investment found in the Paradise Papers. "It really calls into question the purity of the science they are communicating to the public."

Before the controversy over Mercer, the museum faced protests when the billionaire conservative political activist and climate change denier David I. Koch, whose family earned much of its wealth from the energy sector, was a trustee. He left the board two years ago, though he said the departure was not related to protests. (Tom Brokaw, an NBC News special correspondent, currently serves on its board, and was not involved in the reporting of this story.)

World Wildlife Fund

The World Wildlife Fund (WWF), based in Washington, was forthcoming about its investment in Denham. When contacted by NBC News about the disclosures in the Paradise Papers, the WWF asked Denham to be released from confidentiality agreements that the WWF said barred it from discussing its investment.

The WWF, which has taken a strong public position against climate change, invested in the same Denham energy fund as the museum.

The WWF began seeking to unwind its investments in the oil and gas industry beginning in 2013, according to Marsh, the chief operating officer. The group sought fund managers who favor conservation investments. But the WWF has found that with investments like the $2.3 million it put into Denham, that is easier said than done, Marsh said.

The WWF expects its investment in Denham to end by 2020, and estimated its value at about $400,000. Marsh said the difficulty shedding the investment is finding someone who would buy it, and at a price where any financial losses are minimized.

The WWF also owns stakes in two other private equity concerns that are invested in fossil fuels, Marsh said. They are not disclosed in the Paradise Papers. Marsh declined to name them, but said the three stakes consist of 0.4 percent of its portfolio, roughly $800,000, and end by 2020.

The WWF decided that instead of divesting from these three funds, it would put money into a Deutsche Bank financial instrument designed to offset profits from oil and gas. The WWF instrument loses money when fossil fuel stocks rise, and earns money when the stocks fall.

"If we own fossil fuel companies, we own climate change."

Ellen Dorsey, executive director of the $156 million Wallace Global Fund, said divesting from private equity holdings in fossil fuels is not that hard, and nonprofits should move faster.

"If your portfolio is too complex for you to be able to manage it, and be able to withdraw from investments that provide some kind of material risk to your returns, then there's a problem with the way you're managing your portfolio," she said.

But another expert said that divesting creates a risk of losing money. The major hurdle is typically finding a buyer for the stake in the private equity fund without taking a loss on the deal, according to Robert Whitelaw, a finance professor at New York University.

The Wallace fund divested itself from direct and indirect investments in oil and gas, Dorsey said, and started Divest-Invest Philanthropy, which encourages foundations to do the same.

"If we own fossil fuel companies, we own climate change," Dorsey said.

Fossil fuels on campus

Other news organizations examining the Paradise Papers cache have outlined how university endowments have invested in fossil fuels while elsewhere on campus activists, and sometimes the university's financial managers, are fighting against climate change.

NBC News found two universities in the Paradise Papers that had investments in private equity fossil fuel funds but were also among 13 schools that formed the University Climate Change Coalition earlier this year to help cities, states and businesses reduce their carbon footprints

The University of Washington committed $9 million, and a foundation run by the University of California pledged $4 million in the Denham fund, according to the same Paradise Papers document from 2009 that revealed the museum and WWF investments.

People walk past cherry blossoms on the first day of spring on the campus of the University of Washington, in Seattle on March 20, 2018. Elaine Thompson / AP

The University of Washington pledged in 2015 to divest from coal, and has shed its direct holdings, according to Victor Balta, a spokesman for the school. The university, with a $3 billion endowment, stated at the time that "further action by this board is neither recommended nor warranted" for other fossil fuels like oil and gas. The university's latest financial reports, dated mid-2017, showed that Denham has remained a fund manager.

At the University of California, regents pledged in 2014 to withdraw holdings by its endowment and pension funds in coal and oil sands extraction.

Since then, it has sold at least $150 million in fossil fuel investments. It promised to shed more holdings as part of a wide range of environmental efforts, including financing renewable energy concerns and making its campuses carbon neutral in seven years. In 2017, students on several campuses protested ongoing investments in fossil fuels. The university system, which oversees about $118 billion in investments, promised to further reduce its stake in fossil fuels, which is currently about 3 percent of its portfolio.

A spokesperson for the University of California, San Francisco Foundation, which owns the Denham stake, said, "Our policy is not to comment on individual investments."

Elsewhere in the Paradise Papers, NBC News found evidence that nonprofit foundations which finance environmental projects also put money into investments in the oil and gas industry.

The David and Lucile Packard Foundation, based in Silicon Valley, ranks among the wealthiest foundations in the U.S., with an endowment worth more than $7 billion. It has given dozens of grants to environmental groups, including the Nature Conservancy and the Natural Resources Defense Council (NRDC).

The Paradise Papers show the Packard Foundation put $50 million in the private equity concern Energy Capital Partners III L.P., which financed oil and gas infrastructure. It is managed by the U.S.-based private equity firm Energy Capital Partners, a firm focused on financing the energy sector.

The foundation said it does not shy away from oil and gas investments.

"We give these (fund) managers the discretion, with no screens, to invest in ways that will maximize the growth of our endowment," wrote Felicia Madsen, a foundation spokeswoman, in response to questions by NBC News.

The Energy Capital fund has invested in U.S. petroleum and gas-related operations as well as several international power-related concerns, along with solar and renewable investments, according to Bloomberg, government securities filings and other business news accounts.

The Nature Conservancy said the Packard Foundation gave it more than $150 million over the past four decades for environmental efforts. The conservancy said it is "grateful" for the support, praised the foundation as "a global leader in addressing climate change," and said that oil and gas companies need to do more to reduce climate threats. It did not answer questions about whether it has talked with Packard about the foundation's investments in fossil fuels.

Natural Resources Defense Council spokeswoman Jenny Powers praised the foundation for its "long history of supporting just causes." She said the council itself has been working to ensure its investments do not include fossil fuels, but said any questions about the Packard Foundation's finances are for that organization to answer.

Students from Fossil Free Cal protest UC investment in fossil fuel companies on Nov. 18, 2014, in Berkeley, California. Alex Milan Tracy / Sipa USA - AP

Packard is not the only foundation that supports environmental projects and also holds stakes in Energy Capital Partners, according to the Paradise Papers.

The Philadelphia-based William Penn Foundation invested $15 million with Energy Capital, and its most recent tax filings show holdings in four other oil and gas commodity funds. Asked for comment, Rebecca Morley, a foundation spokeswoman, said the foundation began reviewing its finances last year "to better understand the connections between our mission and our investments."

"We recognize the importance and complexity of this for institutions today, and will continue a serious process to examine how best practices apply to our work," she said

The William Penn Foundation awarded grants to dozens of environmental projects in 2017 alone.

Among them is the Clean Air Council, which bills itself as Philadelphia's oldest environmental nonprofit. Joseph Minott, executive director for the council, said he did not know about the foundation's oil and gas investments. "That would be something I'd have to look into and discuss with the foundation," he said. "It's not something that I've typically done."

A skeleton of a Barosaurus, right, and Allosaurus in the Theodore Roosevelt Rotunda is seen at the American Museum of Natural History on Oct. 25, 2012 in New York. Stan Honda / AFP - Getty Images file

Another recipient of the foundation's grants is the Delaware Riverkeeper Network, which works on protecting the Delaware River. Maya K. van Rossum, head of the group, said she was unaware of the foundation's investments in energy. "My organization supports a clean energy future," she wrote NBC News in response to questions. "We also encourage impact investments and divestment."

Both groups have fought fossil fuel projects.

They were both involved in litigation to prevent Middlesex Township, north of Pittsburgh, from expanding shale gas development. The Delaware Riverkeeper Network opposes the EastPenn gas pipeline proposed to cut through Pennsylvania and New Jersey, and objects to a proposed gas power plant near Reading, Pa. The Clean Air Council opposes legislative proposals to relax Pennsylvania's pollution controls, and works to fight what it terms "dirty energy."

Little transparency in private investments

It is difficult for the public and groups like the Clean Air Council and Delaware Riverkeeper Network to learn exactly how foundations and nonprofits invest their endowments.

Every year, nonprofits file 990 tax forms that are open for public inspection. The rules for filling out the forms do not require a detailed list of each private equity investment. Some, for instance, lump all their private equity holdings into a single summary entry on their tax forms.

"Some organizations are very sophisticated and skilled at sort of filing the 990 in ways that make the data sort of unapproachable," said Marc Owens, former head of the Exempt Organizations Division at the IRS.

The Paradise Papers offers a rare glimpse that provides more detail in how some have invested in offshore accounts. The leaked trove of documents includes contracts, emails and spreadsheets detailing thousands of transactions, leaked from the Bermuda-based law firm Appleby, which specializes in offshore financial deals.

The leaks were obtained by German newspaper Süddeutsche Zeitung and shared with the International Consortium of Investigative Journalists (ICIJ), which organized collaboration among news organizations around the world, including NBC News, to sift through the files. In October, Appleby, in response to the leak, stated, "We are disappointed that the media may choose to use information which could have emanated from material obtained illegally."

More than 200 nonprofits were found in the trove of documents made available by ICIJ to NBC News. Many of them hired Appleby to broker offshore investments for their endowment funds. The endowments from the museums, charities, universities and other nonprofits included in the Paradise Papers are worth well north of half a trillion dollars.