The law, which made it illegal to transport migrants through Niger, was passed in May 2015 as the number of people travelling across the Mediterranean Sea from Africa reached record highs, creating a political and humanitarian crisis in Europe where governments came under pressure to stop the influx.
Niger's junta, which took power in a July coup, repealed the law on Saturday and announced it on Monday evening on state television.
The junta is reassessing its relations with former western allies who condemned the coup, and is seeking to shore up support at home, including in the northern desert communities that had benefited most from migration.
The number of migrants moving through Niger, a main transit country on the southern fringe of the Sahara Desert, dropped sharply over the years because of the law, but the change drained the lifeblood from towns and villages that had fed and housed migrants and sold car parts and fuel to traffickers.
In return, the European Union launched the 5 billion euro Trust Fund for Africa in 2015, aimed at eradicating the root causes of migration, but many felt it was not enough.
Unemployment soared in places like the ancient city of Agadez, a popular gateway to the Sahara.
How European leaders greet the news, and the impact on migration to Europe, is yet to be seen.
But some welcomed it. Andre Chani used to earn thousands of dollars a month driving migrants through the desert before police impounded his trucks in 2016. He plans to restart his business once he has the money.
"I'm going to start again," he said via text message from Agadez on Monday. "We are very happy."