NIAMEY, Niger — In a bare suite of prefab offices, inside a compound off a dirt road, French bureaucrats are pushing France’s borders thousands of miles into Africa, hoping to head off would-be migrants.

All day long, in a grassy courtyard, they interview asylum seekers, as the African reality they want to escape swirls outside — donkey carts and dust, joblessness and poverty, and, in special cases, political persecution.

If the French answer is yes to asylum, they are given plane tickets to France and spared the risky journey through the desert and on the deadly boats across the Mediterranean that have brought millions of desperate migrants to Europe in recent years, transforming its politics and societies.

“We’re here to stop people from dying in the Mediterranean,” said Sylvie Bergier-Diallo, the deputy chief of the French mission in Niger.