Environmentalists claimed victory last week as President Barack Obama rejected efforts to build a massive pipeline from Canadian oil fields into the United States. Explaining his Keystone XL pipeline decision, Obama said the world must “keep some fossil fuels in the ground rather than burn them and release more dangerous pollution into the sky.” That statement was echoed by Democratic presidential candidates including Hillary Clinton, who said Monday, “There are some places where we have to keep fossil fuels in the ground or under the ocean.”

Yet Obama and Clinton have both backed major policies boosting the fossil fuel industry -- and raised significant campaign cash from that industry. Several lobbyists who have been raising money for Clinton’s 2016 campaign have represented the oil and gas industry, Mother Jones reported.

Although Obama rejected the proposed 875 miles of Keystone pipeline, his presidency has coincided with the United States building roughly 12,000 miles of new oil and gas pipelines, according to the Financial Post. His administration had also moved to expand oil and gas drilling off the coast of the United States and open up the Arctic to oil and gas drilling, though the latter plan was curtailed after Royal Dutch Shell backed out.

Three years ago, Obama’s aides disputed assertions that his administration was attempting to limit fossil fuel development. In one statement from the president’s senior adviser Dan Pfeiffer, the White House boasted that “the administration has approved hundreds of permits for drilling in the Gulf of Mexico”; declared that “since 2008, U.S. oil and natural gas production has increased each year”; and promised to “take every step possible to expedite the necessary federal permits” for TransCanada’s proposed pipeline in Oklahoma.

And only one day before last week’s Keystone announcement, Obama’s administration released the text of a 12-nation trade deal called the Trans-Pacific Partnership that includes no mention of climate change -- and which environmentalists say would empower fossil fuel firms to challenge domestic environmental laws in international tribunals.

Clinton and her aides played a major role in promoting the TPP when she was U.S. Secretary of State. In that position, she also said she was “inclined to approve” the Keystone pipeline, and her husband, former President Bill Clinton, said America should “embrace it.”

Hillary Clinton changed course in September and announced that she opposed the Keystone pipeline, but when she was secretary of state, her department approved another pipeline designed to tap into tar-sands oil from the same region of Canada that Keystone was designed to serve. The Clinton-led department said the pipeline would “advance a number of strategic interests.” Environmental groups such as Earthjustice told Reuters: “It means large amounts of more air pollution, large amounts of water pollution and extra [greenhouse gases] because more energy is required to convert this [heavy oil] into a refined, usable petroleum product.” In 2014 the Obama administration allowed the company operating the Alberta Clipper pipeline to significantly expand the amount of tar-sands oil it was pumping.

Though Clinton recently announced her opposition to drilling in the Arctic Ocean, she has supported expanding other forms of offshore drilling -- including in the Gulf of Mexico in the years leading up to the Deepwater Horizon disaster.

According to a scorecard of Senate votes compiled by the League of Conservation Voters (LCV), Clinton cast two votes in support of 2006 legislation to vastly expand drilling in the Gulf. Those votes put her on the opposite side of then-Sen. Barack Obama. That same year, Sen. Bernie Sanders (now her 2016 rival) voted against a House measure to expand offshore drilling. Clinton also voted in 2001 to kill a measure that would have restricted such drilling off the coast of Florida. Sanders voted for the restrictions.

Sanders -- who last week introduced legislation restricting drilling on public lands and offshore areas -- received a 95 percent lifetime rating from LCV. Clinton received an 82 percent rating. On Monday, LCV -- which is run by former Clinton EPA administrator Carol Browner -- announced it is endorsing Clinton in the 2016 presidential race. Sanders has been endorsed by another powerful environmental group, Friends of the Earth.

While supporting fossil fuel development, both Obama and Clinton attracted major campaign cash from the oil and gas industry. In 2008, they were among the Senate’s top 6 recipients of campaign donations from the industry, according to data compiled by the Center for Responsive Politics. In all, Obama has raised $1.8 million from oil and gas sources, while Clinton has raised more than $717,000.