In stifling heat, a Saudi security guard sprayed Muslim pilgrims with water as they advanced through Mina for the final rite of the hajj, the "Stoning of the Devil" that has proved lethal in past years.
The 2015 incident killed almost 800 people, according to Riyadh, when two large groups of pilgrims arrived together at a crossroads in Mina, a few kilometres east of Mecca, on their way to performing the stoning ritual.
The event was held for heads of state, Islamic dignitaries, guests of the Custodian of the Two Holy Mosques, guests of the government bodies, and heads of delegations and pilgrim affairs offices, who performed the Hajj rituals this year.
Among one group of American, Canadian and British pilgrims in Mecca this week for the annual haj, the US president and policies they say target Muslims and immigrants are a regular conversation topic.
Prince Khalid revealed that an integrated plan for the development of the holy sites will be announced soon, that will accommodate more pilgrims, including the services provided.
Devout Muslims are expected to perform the Haj, one of Islam's five pillars, at least once in their lifetime, provided they are fit enough and have the financial means to do so.
Authorities have deployed more than 100,000 security forces to secure the hajj and assist pilgrims.
As pilgrims took turns to complete the last rites of Hajj, the king returned to Jeddah.
It is the world's largest annual Muslim gathering, with over 2.3 million people attending this year.
Muslim pilgrims gather on Mount Mercy on the plains of Arafat during the annual hajj pilgrimage, outside the holy city of Mecca, Saudi Arabia August 31, 2017.
Saleh congratulated Governor Akinwunmi Ambode and the Lagos State Muslim Pilgrims Welfare Board for provision of standard facilities during the hajj and urged pilgrims to pray for the leadership of the board.
It further said that the country plans to leverage Haj as an opportunity to position Islam as a united, tolerant and peaceful faith, so that pilgrims take a message of hope and unity back home.
Later in the day, they return to Mina to stay overnight and throw stones for two more days.
Tehran reported the largest number of stampede victims, with 464 Iranians among the dead.
Noura Sulieman, a pilgrim from the Philippines, said she'd been to the hajj many times before and was here again to pray for her family.
Pilgrims then cut their hair and sacrifice an animal - meat from which is traditionally distributed to the poor - before celebrating the Eid al-Adha, or "Feast of the Sacrifice", which began on Friday.
The kingdom has received credit for its management of the massive crowds that descend upon Mecca each year - and blame when things go wrong at the hajj.