NEW YORK (Reuters) - U.S. lawmakers have amended a government spending bill to extend a tax credit for the biodiesel industry through 2022 and retroactively to when it expired beginning in 2018, a move welcomed by an industry that has seen 10 plants shut since the credit lapsed.

The $1-per-gallon subsidy was included late on Monday in an amendment to a spending package that the U.S. Congress must pass by Friday to avoid a government shutdown. The credit would apply retroactively to the last two years.

The credit began in 2005 as a way to help farmers and reduce petroleum imports by supporting biofuels. At a cost of nearly $2 billion per year, it is among the most expensive U.S. energy subsidy programs, supporting the market for biodiesel, a fuel made from cooking oil, soybean oil and animal fats.

The credit lapsed starting in 2018 due to congressional inaction. Over the last few months, biodiesel trade groups and Midwest farmers have increased pressure on Congress to renew the subsidy. Biodiesel groups argue that the credit’s expiration has thrown confusion into future supply contracts and tightened credit lines.

If the spending bills with the amendment are not passed by Congress, some fear the industry will see additional plant shutdowns in the new year.

In September, 95 U.S. biodiesel plants produced 142 million gallons of the fuel, down from 164 million gallons a year earlier, according to the Energy Information Administration.

“Today’s announced deal provides the policy certainty that the biodiesel industry has been seeking to support investments and continued growth of production,” said Kurt Kovarik, vice president of federal affairs for the National Biodiesel Board.

“Now it’s important that we do our job and pass this year an appropriation package, and with it there will be these provisions on extenders,” said Iowa Senator Chuck Grassley, a leading proponent of biofuels, in a call with reporters on Tuesday.