Congress on Wednesday night released a fiscal 2018 spending bill that rejects Trump administration efforts to reduce funding for the Environmental Protection Agency and Energy Department.

After President Trump threatened to make massive cuts to the EPA budget, Congress decided to keep funding levels the same from fiscal 2017, at $8.1 billion.

Lawmakers decided to boost funding by $66 million for accelerating the cleanup of hazardous Superfund sites, a priority of EPA Administrator Scott Pruitt.

The Energy Department, meanwhile, would receive $34.5 billion in the massive spending deal, a $3.77 billion increase over fiscal 2017.

That includes $2.32 billion for the agency’s energy efficiency and renewable energy division, a 15 percent increase. Trump, who has promoted expanded fossil fuel development, had sought to cut funding for that division.

The agency’s fossil fuels office would get $726.8 million, up $59 million from fiscal 2017 and an increase of $447 million above Trump’s budget request.

The Energy Department’s clean energy research hub, which Trump wanted to eliminate, also would see a funding increase.

Funding for Advanced Research Projects Agency-Energy, or ARPA-E, is increased by $47 million for a total of $353 million. ARPA-E is a program with bipartisan support in Congress that funds innovations in energy technology, such as battery storage.

The Energy Department budget also emphasizes cyber security, which is a key focus of policymakers after Russia has tried attacking the nation’s power grid.

Cybersecurity efforts would get $248 million in the spending package, an increase of $18 million.

The spending deal also continues what is becoming a tradition in Congress of ordering sales from the nation’s Strategic Petroleum Reserve. It calls for a sale of another 10 million barrels of government-owned crude to be sold from the reserve in fiscal 2020 and 2021.

Congress recently has been tapping the strategic oil reserve, an emergency fund, for deficit reduction and other items.

The Republican tax reform legislation required sales from the reserve in 2026 and 2027. And the Energy Department used the petroleum reserve during last year’s hurricane season.

The fund currently has 665 million barrels of crude.