President Trump signed the 2018 U.S. Farm Bill on Thursday to the cheers of environmentalists, who praised its creation of a new multi-million dollar climate change program.

Trump signed the long-awaited agriculture measure, saying it was a "great bill" that was difficult to pass — but had to be passed to support ranchers and farmers.

The $867 billion farm bill provides billions of dollars in aid to farmers while avoiding cuts to the federal food stamp program that some members of the GOP sought to slash.

The environmental community praised the bill's passage for slightly different reasons, pointing to the inclusion of a new climate change pilot program to help farmers deal with the effects of climate change.

The bill provides $25 million per year to begin "conservation innovation" trials for a soil rotation pilot project to help farmers improve soil health while lowering greenhouse gases that are blamed for global warming.

Enacting such soil-based climate change programs was a key focus at last week's United Nations conference on implementing the Paris climate accord signed by former President Barack Obama. The Trump administration used the conference to reiterate the president's decision to exit the global climate accord.

Trump made no mention of the environmental pieces of the farm legislation in making public remarks on Thursday. Instead, he quickly moved on to discuss the need for Congress to fund border security and a wall, while also touting a prison reform bill he signed earlier.

"The farm bill is the largest source of funding for conservation on private lands in the U.S.," said Fed Krupp, the president of the Environmental Defense Fund, a national group that has been active in the courts suing Trump for rolling back climate change regulations.

"The bipartisan bill rewards farmers for fighting climate change, preparing for extreme weather and protecting water quality," Krupp continued.

Overall funding for conservation programs in the bill totaled $6 billion per year. There is also $300 million in annual funding for the Regional Conservation Partnership Program, which is expected to bring almost $3 billion in matching funds from the private sector, according to Krupp's group.