Two million Muslim pilgrims began leaving the holy city of Mecca on Monday, concluding the annual hajj during which Saudi leaders lashed out at Islamic extremism.
The pilgrimage passed off without any cases of Ebola or Middle East Respiratory Syndrome (MERS) after Saudi authorities engaged thousands of health workers to make sure pilgrims were protected from two deadly viruses, the acting health minister said.
The faithful symbolically stoned the devil for a third day in the Mina Valley before many moved to nearby Mecca.
There, they were to circumambulate the holy cube-shaped Kaaba before returning home, having reached the spiritual peak of their lives.
The hajj, one of the world's largest religious festivals, this year drew believers from 163 nations.
Some of the faithful will remain until Tuesday, officially the last day of hajj.
"I wish I could always stay here and not return home," said an Indonesian pilgrim who gave her name only as Umm Mohammed, 58, speaking in Arabic.
This year's hajj attracted just over two million domestic and foreign believers, including almost 1.4 million from abroad, according to the official SPA news agency.
The numbers are roughly the same as last year.
The hajj drew a cross-section of humanity, from presidents to commoners, including a wounded Syrian rebel war veteran.
The pilgrimage came as Saudi Arabia and four other Arab states took part in or gave support to US-led air strikes against Islamic State group jihadists in Syria.
The Sunni extremists have seized large parts of Syria and Iraq, declaring a "caliphate" where they have been accused of carrying out widespread atrocities, including mass executions, crucifixions and beheadings, and forcing women into slavery.
- Crackdown on unauthorised pilgrims -
Saudi King Abdullah told leaders of groups of pilgrims from Islamic countries on Sunday that extremism must be eradicated because it "has nothing to do with Islam".
On Friday the Sunni kingdom's top cleric, Sheikh Abdul Aziz al-Sheikh, said Muslim leaders must strike the enemies of Islam with "an iron hand".
Signup to our newsletter and follow us on Facebook and Twitter!
He made the comments during the peak of hajj from the holy site of Mount Arafat, where the Prophet Mohammed is believed to have given his final sermon 14 centuries ago.
Some pilgrims denounced atrocities by the Islamic State group but many also expressed concerns about the US-led air war against the extremists.
Authorities deployed thousands of health workers to protect pilgrims from Ebola and MERS.
They did not allow pilgrims to come from Guinea, Liberia and Sierra Leone, the West African states hardest hit by Ebola.
"I am pleased to announce the hajj was free of all epidemic diseases," acting health minister Adel Fakieh said in Mina.
There were also improved crowd-control measures, and an unprecedented crackdown on pilgrims without the required permits.
More than 70,000 security force personnel were assigned to assist the pilgrims, commander of the hi-tech Command and Control Centre for Hajj Security, Major General Abdullah al-Zahrani, told reporters in Mina on Sunday.
The centre features a network of screens linked to thousands of surveillance cameras across the holy sites.
Sensors count the flow of pilgrims moving through a four-storey structure for the devil-stoning ritual.
"There were no security gaps during hajj," said Zahrani, who added that more than 380,000 people without permits were sent back after they attempted to join the pilgrimage.
Roads in Arafat and Mina, usually blocked by illegal pilgrims sleeping on the streets, were clear this year, AFP reporters observed.
"No camping on roads, hajji. Move on," security men in Mina reminded pilgrims caught resting in the open.
Saudi authorities have spent billions of dollars on safety projects for the hajj, which has been almost incident-free in recent years after earlier stampedes and fires.
A rockslide in Mina on Sunday left 14 pilgrims with "medium and minor" injuries, SPA reported, but no major trouble was reported during the rituals which began on Thursday.
Hajj is one of the five pillars of Islam, which all able Muslims must perform once in their life if they have the means to do so.