You would have to be less than human not to be moved by images of the refugee crisis threatening to overwhelm Europe: the scenes in Budapest, the 71 bodies found in the abandoned lorry in Austria, the 200 people drowned when their boat capsized off the coast in Libya and, most heartbreaking of all, the body of three-year-old Aylan Kurdi, lifeless on a Turkish shore: an image that will linger long in the mind as a symbol of a world gone mad.

This is the greatest humanitarian challenge faced by Europe in decades. Angela Merkel was not wrong when she said: “If Europe fails on the question of refugees, its close connection with universal civil rights will be destroyed.”

The influx of refugees overwhelming parts of Europe is a massive crisis, but it is at just such times that it is worth remembering that the Chinese ideogram for “crisis” also means “opportunity”. Now is a unique opportunity to show that the ideals for which the European Union and other international bodies such as the United Nations were formed are still compelling, compassionate and humane.

Many of the conventions and protocols establishing legal rights for refugees emerged in the aftermath of the second world war, as did the Universal Declaration of Human Rights. One of the dark moments in that history occurred in July 1938, when representatives of 32 countries gathered in the French spa town of Evian to discuss the humanitarian disaster that everyone knew was about to overtake the Jews of Europe wherever Hitler’s Germany held sway. Jews were desperate to leave. They knew their lives were at risk and so did the politicians and aid agencies at the conference. Yet country after country shut its doors. Nation after nation in effect said it wasn’t their problem.

At such times, even small humanitarian gestures can light a flame of hope. That is what happened in Kindertransport, the initiative that saw 10,000 Jewish children rescued from Nazi Germany. Half a century later, I came to know many of those who had been rescued. They loved Britain and sought richly to contribute to it. I and many other Jews of my generation grew up with that love, knowing that without Britain’s willingness to provide our parents and grandparents with refuge, they would have died and we would not have been born. As long as human history is told, these acts of humanitarianism will stand as a triumph of the spirit over political expediency and moral indifference.

Sixty years after Kindertransport, a gathering took place in London of more than 1,000 of those who had been rescued. It was a highly emotional day as one after another told their stories. But the speech that had us all in tears was not from one of the rescued children but from the late Lord Attenborough, whose family were among the rescuers.

He spoke of how his parents summoned their three boys and told them they wanted to adopt two young Jewish girls from Germany, Helga and Irene. They explained the sacrifices they would all have to make. They would now be a family of seven rather than five, which meant that they would have to share more widely, and that, they said, included their love, because “you have us, but they have nobody”. The boys agreed and the two girls became part of their family. As he told this story, Lord Attenborough wept and said that was the most important day of his life. Suddenly, we realised that it is the sacrifices we make for the sake of high ideals that make us great and that applies to nations as well as individuals.

Even in the best-case scenario, Europe alone cannot solve the problems of which the refugees are the victims. The conflicts that have brought chaos to the Middle East continue to defy any obvious solution. Every option that has been tried has seemed to fail: military intervention in Afghanistan and Iraq, no-fly zones in Libya and non-intervention in Syria. None has put out the smouldering fires of unrest, religious and ethnic discord and civil war. It is all too easy to say that this is not our problem and, besides, it is happening a long way away.

Yet nothing in our interconnected world is a long way away. Everything that could go global does go global, from terror to religious extremism to websites preaching paranoia and hate. Never before have John Donne’s words rung more true: “Any man’s death diminishes me, because I am involved in mankind.” Therefore, “never send to know for whom the bell tolls; it tolls for thee”.

A strong humanitarian response on the part of Europe and the international community could achieve what military intervention and political negotiation have failed to achieve. This would constitute the clearest evidence that the European experience of two world wars and the Holocaust have taught that free societies, where people of all faiths and ethnicities make space for one another, are the only way to honour our shared humanity, whether we conceive that humanity in secular or religious terms. Fail this and we will have failed one of the fundamental tests of humanity.

I used to think that the most important line in the Bible was “Love your neighbour as yourself”. Then I realised that it is easy to love your neighbour because he or she is usually quite like yourself. What is hard is to love the stranger, one whose colour, culture or creed is different from yours. That is why the command, “Love the stranger because you were once strangers”, resonates so often throughout the Bible. It is summoning us now. A bold act of collective generosity will show that the world, particularly Europe, has learned the lesson of its own dark past and is willing to take a global lead in building a more hopeful future. Wars that cannot be won by weapons can sometimes be won by the sheer power of acts of humanitarian generosity to inspire the young to choose the way of peace instead of holy war.

Jonathan Sacks was chief rabbi from 1991 to 2013. He supports the Jewish community’s crisis appeal – visit worldjewishrelief.org

■ Comments will be open later today