New York's attorney general sued the Trump administration Tuesday over one of its deals to end an offshore wind project.

Under a deal made public in March, French company TotalEnergies is getting $1 billion — essentially a refund of its leases for offshore wind projects off New York and North Carolina — if it invests the money in fossil fuel projects instead.

WATCH: Why the Trump administration is paying billions to abandon wind farms

State attorneys general from Connecticut, Maine, Massachusetts, New Jersey, Rhode Island and Vermont joined New York in challenging the cancellation of the lease off New York, the larger of the two projects and the bulk of the payout. They say it will harm their states' economies, energy grids and climate goals.

"This administration cooked up a sham deal to pay a foreign energy company hundreds of millions of taxpayer dollars to abandon offshore wind and invest in oil and gas instead," New York Attorney General Letitia James said in a statement. "We are fighting back to stop this illegal agreement that threatens to erase over a thousand union jobs and cheat millions of New Yorkers out of clean, affordable energy."