The number of refugees who have fled Syria has topped five million for the first time since the civil war began six years ago, according to the UN's refugee agency.

Syrians have poured across the borders into Turkey, Lebanon, Jordan and Iraq since anti-government protests in 2011 spiralled into a full-blown conflict between rebels, Islamist militants, government troops and foreign backers.

After levelling off in 2016, refugee numbers rose this year following the military victory by the government and its Russian and Iranian-backed allies in the northern city of Aleppo.

More than half of Syria's population of 22 million people has been uprooted at some point during the conflict.

The latest arrivals into Turkey mean the number of Syrians who have fled the country stands at more than five million people, four years after the UNHCR announced that one million people had fled.

The figure of five million includes refugees who have been resettled in Europe, but the UNHCR urged Europeans to do more to help share a burden that is still largely falling on countries bordering Syria; Turkey has taken in nearly three million Syrians.

France and Germany are both gearing up for crucial elections, with far-right candidates seeking to exploit public fears about immigration.

The UNHCR spokesman Babar Baloch said: "This is not the time to shun Syrian refugees. Our hope is that humanity will not be put on a ballot.

"Europe went through this during the Second World War and there were many countries which supported Europe. Syria is currently going through this trauma and it now needs the world's support. We should not be turning our backs on people in need."

Refugees Greece
Syrian refugees arriving in Lesbos on an inflatable boat with other refugees, having crossed the sea from Turkey to Lesbos Alexander Koerner/ Getty Images

He added: "The solution to the crisis in Syria is political, but in terms of support it is humanity that is needed. We are asking other countries to come forward and help those countries neighbouring Syria that are hosting large numbers of Syrian refugees to share responsibility for resettlement and humanitarian admissions. Those desperate refugees are in need of resettlement."

The German chancellor, Angela Merkel, has defended her government's immigration policy in the face of criticism from the anti-refugee Alternative for Germany party, which will contest seats in the country's elections in September.

Speaking at a conference of the centre-right European People's party in Malta on Thursday, she said: "We had done too little in the past, that is why we took in refugees – because it was the right thing to do."