Authorities in the US state of Arizona have agreed to remove a wall made of shipping containers at the Mexican border following protests.
The state's Republican governor, who had the barrier installed, argued that it would halt migrants crossing into America.
But critics who filed legal challenges have questioned this.
The wall is made out of more than 900 containers and cost at least $80m (£66m) of taxpayer money.
Arizona shares a 600km (370 mile) border with Mexico. Fences have been built along large stretches of it since 2017, when Donald Trump became president.
Governor Doug Ducey began building the barrier in the Coronado National Forest earlier this year in response to what his office described as an "ominous increase" in the number of migrant crossings.
However, the US government sued Mr Ducey last week, claiming the 7km (4 mile) wall was trespassing on federal land because the proper authorisation hadn't been sought.
In an agreement reached on Wednesday with the federal government, Mr Ducey's administration said it would "remove all previously installed shipping containers and associated equipment, materials, vehicles, and other objects" by early January.
The Center for Biological Diversity, an environmental group that operates locally, had also filed two lawsuits against the wall.
It claimed that the container fence divides an important conservation area that is home to vulnerable species, blocking access to waterways and migration routes.