Arizona will take down a makeshift wall made of shipping containers at the Mexico border, settling a lawsuit and political tussle with the U.S. government over trespassing on federal lands.

The Biden administration and the Republican governor entered into an agreement that calls for Arizona to cease installing the containers in the Coronado National Forest — the only national forest along the border — according to court documents filed Wednesday in U.S. District Court in Phoenix.

The agreement also calls for Arizona to remove the containers that were already installed in the remote San Rafael Valley, in southeastern Cochise County, and in the Yuma area where the U.S. Bureau of Reclamation has an easement on the Cocopah Indian Tribe’s reservation. All this must be done by January 4 without damaging any natural resources. State agencies will have to consult with U.S. Forest Service representatives.

Arizona Governor Doug Ducey has long maintained that the shipping containers were a temporary fixture. Even before the lawsuit, he wanted the federal government to say when it would fill any remaining gaps in the permanent border wall, as it announced it would a year ago.

“For more than a year, the federal government has been touting their effort to resume construction of a permanent border barrier. Finally, after the situation on our border has turned into a full-blown crisis, they’ve decided to act,” C.J. Karamargin, Ducey’s spokesman said. “Better late than never.”

“Final details are still being worked out on how much it will cost and when it will start,” Karamargin told The Associated Press.

Representatives for U.S. Customs and Border Protection did not immediately return messages seeking comment Thursday.

The resolution came two weeks before Democrat Katie Hobbs, who opposes the construction, takes over as governor.

The federal government filed a lawsuit last week against Ducey’s administration on behalf of the Bureau of Reclamation, the Department of Agriculture and the Forest Service.

The federal government “owes it to Arizonans and all Americans to release a timeline,” Ducey wrote last week, responding to news of the pending federal lawsuit.

The work of placing up to 3,000 containers at a cost of $95 million was about a third complete, but protesters concerned about its impact on the environment held up work in recent days.

Meanwhile, limits on asylum-seekers hoping to enter the U.S. had been set to expire Wednesday. The Biden administration has asked a court to lift the Trump-era restrictions.