The official, who spoke on the condition of anonymity for security reasons, went on to describe how the money was transferred. European governments send an escort, he said, who travels with the money several hundred miles into the desert until the last safe outpost, usually leaving from Ouagadougou, the capital of Burkina Faso, or Niamey in Niger. The negotiator and his driver then continue driving all day, and sometimes all night, traversing a roller coaster of undulating dunes.

Once the negotiator arrives at the meeting point, he waits until his satellite phone beeps with a text message. In the message is a pair of GPS coordinates.

He drives five to six more hours until he reaches the new address in the sand and waits for the next text, containing another set of coordinates. The process is repeated a minimum of three times before the jihadists finally show themselves.

The money is counted on a blanket on which the fighters sit cross-legged, their guns at their sides, the official said. The millions are then divided into stashes, wrapped in plastic and buried in holes hundreds of miles apart, a detail he was able to glean after repeated meetings with the terrorist cell. They mark the location on their GPS, keeping track of it just as they track their buried cars and fuel drums.

The money is written off by European governments as an aid payment, or else delivered through intermediaries, like the French nuclear giant Areva, a state-controlled company that a senior negotiator said paid €12.5 million in 2011 and €30 million in 2013 to free five French citizens. (A spokesman for Areva denied in an email that a ransom had been paid.)

In Yemen, the intermediaries are Oman and Qatar, which pay the ransoms on behalf of European governments, including more than $20 million for two groups of hostages released in the past year, according to European and Yemeni officials.

Almost a year into her captivity in 2012, Mariasandra Mariani thought she could not take it anymore. Her captors were holding her in a landscape of black granite in northern Mali, which amplified the suffocating heat. When the wind blew, it felt as if someone were holding a blow dryer inches from her skin. She spent all day next to a bucket of water, sponging herself to try to keep cool.