The heavily armed troops are positioned around oases in Niger’s vast northern desert, where temperatures routinely climb beyond 100 degrees.
While both Al Qaeda and the Islamic State have branches operating in the area, the mission of the government forces here is not to combat jihadism.
Instead, these Nigerien soldiers are battling human smugglers, who transport migrants across the harsh landscape, where hundreds of miles of dunes separate solitary trees.
The migrants are hoping to reach neighboring Libya, and from there, try a treacherous, often deadly crossing of the Mediterranean to reach Europe.
The toll of the military engagement is high. Some smugglers are armed, militants are rife and the terrain is unforgiving: Each mission, lasting two weeks, requires 50 new truck tires to replace the ones shredded in the blistering, rocky sand.
But the operation has had an impact: Niger has drastically reduced the number of people moving north to Libya through its territory over the past two years.
The country is being paid handsomely for its efforts, by a Europe eager to reduce the migrant flow. The European Union announced at the end of last year it would provide Niger with one billion euros, or about $1.16 billion, in development aid through 2020, with hundreds of millions of that earmarked for anti-migration projects. Germany, France and Italy also provide aid on their own.
It is part of a much broader European Union strategy to keep migrants from its shores, including paying billions of euros to Turkey and more than $100 million to aid agencies in Sudan.
Italy has been accused of paying off militias in Libya to keep migrants at bay. And here in Niger, some military officials angrily contend that France financed a former rebel leader who remains a threat, prioritizing its desire to stop migration over Niger’s national security interests.
Since passing a law against human trafficking in 2015, Niger has directed its military to arrest and jail migrant smugglers, confiscate their vehicles and bring the migrants they traffic to the police or the International Organization for Migration, or I.O.M. The migrants are then given a choice whether to continue on their journey — and risk being detained again, or worse — or given a free ride back to their home country.
The law’s effect has been significant. At the peak in 2015, there were 5,000 to 7,000 migrants a week traveling through Niger to Libya. The criminalization of smuggling has reduced those numbers to about 1,000 people a week now, according to I.O.M. figures.
At the same time, more migrants are leaving Libya, fleeing the rampant insecurity and racist violence targeting sub-Saharan Africans there.
As a result, the overall flow of people has now gone into a notable reverse: For the last two years, more African migrants have been leaving Libya to return to their homelands than entering the country from Niger, according to the I.O.M.
One of Niger’s biggest bus companies, Rimbo, used to send four migrant-filled buses each day from the country’s capital in the south, Niamey, to the northern city of Agadez, a jumping off point for the trip to the Libyan border.
Now, the company has signed a two-year contract with the I.O.M. to carry migrants the other way, so they can be repatriated.
On a recent breezy evening in Niamey, a convoy of four Rimbo buses rolled through the dusty streets after an arduous 20-hour drive from Agadez, carrying 400 migrants. They were headed back home to countries across West Africa, including Guinea, Ivory Coast and Nigeria.
For leaders in Europe, this change in migrant flows is welcome news, and a testament to Niger’s dedication to shared goals.
“Niger really became one of our best allies in the region,” said Raul Mateus Paula, the bloc’s ambassador to Niger.
The agency’s head, Adam Kamassi, said his team usually rescues between 20 to 50 people every time it goes out. On those trips, it nearly always finds three or four bodies.
The crackdown on human smuggling has also been accompanied by economic decline and security concerns for Niger.
“I know of about 20 people who have become bandits for lack of work,” said Mahamadou Issouf, who has been driving migrants from Agadez to southern Libya since 2005, but who no longer has work.
For example, the health clinic in Dirkou, once a major migrant way station in northern Niger, now has fewer paying clients because the number of migrants seeking has dwindled. Store owners who relied on the steady flow of people traveling through have gone bankrupt.
Hassan Mohammed is another former migrant smuggler who lost his livelihood in the crackdown.
A native of Dirkou, Mr. Mohammed, 31, began driving migrants across the desert in 2002, earning enough in the process to buy two Toyota pickup trucks. The smuggling operation grew enough that he began employing his younger brothers to drive.
Today, Mr. Mohammed’s brothers are in prison, serving the six-month sentences convicted smuggler drivers face. His two pickup trucks are gathering dust, along with a few dozen other confiscated vehicles, on a Niger army base. With no income, Mr. Mohammed now relies on the generosity of friends to survive.
Not all the migrants returning through Niger end up in their home countries, but remain in the country, competing for scarce jobs.
Some 2,000 Sudanese nationals who left Libya have wound up staying in Agadez, while a number of Eritreans, Ethiopians and Somalis are living in Niamey, while applying for asylum in France under a new program in which France considers applications for refugee status on the southern side of the Sahara.
With Europe as a primary beneficiary of the smuggling crackdown, the European Union is eager to keep the effort in place, and some of the bloc’s aid finances a project to convert former smugglers into entrepreneurs. But the project is still in its pilot stage more than two years after the migrant crackdown began.
Ibrahim Yacouba, the former foreign minister of Niger, who resigned earlier this year, said, “There are lots of announcements of millions of euros in funding, but in the lived reality of those who are in the industry, there has been no change.”
The crackdown has also raised security concerns, as France has taken additional steps to stop migration along the Niger-Libya border that go beyond its asylum-processing center.
From its military base in the northern Nigerien outpost of Madama, France funded last year an ethnic Toubou militia in southern Libya, with the goal of using the group to help stop smugglers, according to Nigerien security officials.
This rankled the Nigerien military because the militia is headed by an ex-Nigerien rebel, Barka Sidimi, who is considered a major security risk by the country’s officials. To military leaders, this was an example of a European anti-migrant policy taking precedent over Niger’s own security.
A French military spokesperson said, “We don’t have information about the collaboration you speak of.”
“The fight against clandestine migration is not winnable,’’ said Mohamed Bazoum, Niger’s interior minister.
Even as Libya has experienced a net drop in migrants, new routes have opened up: More migrants are now entering Algeria and transiting to Morocco to attempt a Mediterranean crossing there, according to Giuseppe Loprete, who recently left his post after being the I.O.M.’s director in Niger for four years.
But despite the drawbacks that come with it, the smuggling crackdown will continue, at least for now, according to Mr. Bazoum, the interior minister. Migrant smuggling and trafficking, he said, “creates a context of a criminal economy, and we are against all forms of economic crime to preserve the stability and security of our country.”
For Mr. Mohammed, the former smuggler, the crackdown has left him idle and dejected, with no employment prospects.