When the engine of the leaky fishing vessel spluttered and died, the Italian photographer Guilio Piscitelli had been on the boat crowded with migrants for more than 28 hours. Behind them were wars and revolutions. Ahead was the Italian island of Lampedusa, and the promise of a safer life in Europe.

Between those two worlds loomed the threat of a tragic fate that has befallen thousands of other asylum-seekers.

Everyone aboard knew that boats carrying migrants often sink, and with deadly consequences. In this journey, the bilge pumps stopped working when the engine failed. The open vessel began to pitch and roll, and it risked taking on water. Lampedusa’s coastline was within view, but beyond reach. The migrants’ lives were at the whim of the Mediterranean. There was a rising sense of panic.

“Everyone was shouting in Arabic,” Mr. Piscitelli said. “There was an incredible feeling of fear out there in the middle of the ocean.”

Photo

There had been no mobile phone network for more than a day, but as they drifted, Mr. Piscitelli kept checking his phone. Eventually, he picked up a faint signal.

He dialed an emergency number. Within an hour, the Italian coast guard was on the scene.

“We were absolutely lucky,” Mr. Piscitelli said. “The boat could easily have sunk.”

The rescue, only one step on a long journey for the migrants, was a turning point for the photographer.

“It was the most important experience of my life,” he said.

The crossing took place in April 2011, during the early days of the Arab Spring, long before the world’s attention was gripped by desperate scenes of mass migration from the Middle East and Africa toward Europe. The experience gave Mr. Piscitelli personal insight into the risks people take in search of safety. And it drove him to embark on a long-term photographic project titled “From There to Here,” which explores the issue of migration by tracing the migrants’ paths across continents.

Photo

“The people on the boat, they understood it was important to have a reporter with them to show their journey,” said Mr. Piscitelli, 33.

He has undertaken a journey of his own, traversing nearly a dozen countries and compiling a body of work over five years. His efforts earned him a 2012 grant from the Magnum Foundation Emergency Fund to continue the project.

Mr. Piscitelli’s background, as a photo archivist at a museum in his hometown, Naples, has informed his longer view of the story. He hopes to do more than raise awareness of the migration crisis as events unfold; he also wants to “create a base of memory of this period and what’s happening and how we manage the situation. It’s enormous.”

His recent images reflect the urgency and drama of a tense refugee summer, with hundreds of migrants arriving on Europe’s shores or being rescued — and dying — at sea. But photographs taken on journeys across the Sahara in previous years offer a slower sense of space, time and distances traveled. In one frame from 2014, a pickup truck overloaded with passengers points toward the vast expanse of desert on the Egypt-Libya border as one barefoot migrant tugs the hand of another who appears to have collapsed exhausted on the sand. Another picture taken last year reflects the European response to the refugee crisis, showing a section of a snaking, 20-mile razor wire fence coiled along the border between Turkey and Bulgaria. While some countries such as Germany have accommodated this year’s surge of migrants, such a reception has not always been the case.

Photo

Mr. Piscitelli has also documented the exploitation, discrimination and abuse experienced by migrants, including making an image of an undocumented Sudanese man who has thick scars sliced across his back from an attack by members of a fascist gang in Greece.

“My work tries to describe the dramatic consequences of the enormous upheavals that are happening all around the Western countries, upheavals that often are due to wrong decisions of our Western policies,” Mr. Piscitelli said on Tuesday.

He gave an interview to Lens by telephone, speaking from the frontier between Hungary and Serbia, where chaos erupted this week. Hungary has closed its borders, leaving thousands stranded and sparking violent clashes between migrants and Hungarian security forces blocking their way.

“This crisis explains to us how the rich world tries to preserve its wealth at a time when the poorest parts of the world are asking to be part of this well-being,” he said.

Mr. Piscitelli’s images and words are reminiscent of “The March,” a 1990 BBC film featuring a Sudanese refugee leading hundreds of thousands of fellow Africans on a journey across the Sahara and the Mediterranean. In Europe, met by fear and hostility, they are told they will never be allowed to cross over. The film’s climax is a confrontation between the crowds of migrants and armed security forces.

At the film’s end, a British politician laments the racial and nationalistic tensions initiated by the mass migration. “We’re just not ready for you yet, that’s all,” she says. “Maybe later. Maybe one day. Dear God I hope so. Or what sort of world are we making?”

Broadcast a quarter-century ago and imagining a futuristic scenario, the film was eerily prescient, as Mr. Piscitelli’s images suggest. He fears that Europe will struggle to absorb the refugees and migrants and that nationalism and racism may only escalate as endless wars and growing deprivation drive more and more people toward Europe.

“I’m a little bit pessimistic,” he said. “But I hope I’m wrong.”

Finbarr O’Reilly is a 2015 World Fellow at Yale, where he is working on a book, “Shooting Ghosts,” about the psychological costs of war, to be published in 2017 by the Viking imprint of Penguin/Random House. He was based in Africa and the Middle East as a Reuters photographer from 2004-15 and was awarded the 2006 World Press Photo of the Year. He is also a 2013 Harvard Nieman fellow and a 2014 Columbia University Ochberg Fellow. Follow him on Twitter, Facebook and Instagram

Follow @nytimesphoto on Twitter. You can also find us on Facebook and Instagram.