Saudi Arabia has warned Muslim pilgrims attending next week's haj in Mecca to avoid exploiting Islam's annual gathering for political reasons, reflecting its worry that turmoil in the region may prompt attacks or damaging displays of discord.
Wearing the clothes and speaking the languages of dozens of nations, hundreds of thousands of pilgrims flocked to Mecca's Grand Mosque for prayers on Friday in a show of religious harmony in a year when the region's Muslim states are plagued by conflict.
"The security forces are ready to confront any irresponsible behaviour that might pollute the purity of haj or endanger the lives of the guests of Allah," interior minister crown prince Mohammed bin Nayef was quoted as saying by state media.
The turbulence and sectarian infighting between Sunni and Shi'ite Muslims that has plagued Arab countries since the 2011 uprisings has grown even more acute this year, as Yemen and Libya joined Syria and Iraq in plunging into civil war.
In Saudi Arabia, three suicide bombings of mosques by sympathisers of Islamic State this year have proved that even Muslim places of worship are at risk of attack by militants.
In the Grand Mosque, worshippers of different nationalities said they hoped the haj would provide a chance for Muslims to set strife aside.
Ali Saeed, who arrived in Saudi Arabia from Jordan after escaping Syria's civil war, prayed rival leaders would "come back to their senses and stop shedding innocent blood".
"Will it ever end? God knows. I hope all our leaders can come to Mecca and share the same faith as all those people do," he said.
As they walked in groups, some joined hands and others wore colourful scarves bearing the name of their country to avoid getting separated or lost. Some pushed relatives in wheelchairs or helped the elderly in the crush.
"I invite all people from Iran and other Muslim countries to come together in Mecca and experience the spirituality," said Abdullah Rahmani, a grey-bearded Iranian.
In past years, the haj has drawn around 3 million pilgrims. Since last year, Riyadh cut back on numbers - enforced through strict visa rules and a ring of checkpoints around the city - to prevent dangerous overcrowding during expansion works. About 1.2 million have arrived so far in 2015.
The crashing of a crane into the Grand Mosque during a storm last week, killing 107, demonstrated the extent of those dangers. But the wider programme of construction over the past 15 years has helped stop repetition of once-common deadly stampedes.