Some 1.4 million Muslim pilgrims from 188 countries started to leave Saudi Arabia on Thursday at the end of what authorities hailed as a successful and incident-free hajj.
Mecca's provincial governor, Prince Khaled al-Faisal bin Abdul Aziz, said the 2013 hajj marked a "qualitative turning point" in the organisation of the annual pilgrimage, marred in previous years by deadly fires and stampedes.
The rites were carried out in a calm atmosphere and free of any political demonstrations, making it a "success" and proving "Islam is a religion of peace, civilisation and progress," he told reporters.
Although the hajj, one of the five pillars of Islam, comes to a close officially on Friday, pilgrims are allowed to leave a day early after taking part in the stoning of the devil ritual.
Pilgrims woke up early on Thursday and began stoning three huge concrete structures in Mina representing Satan straight after sunrise, in accordance with the teachings of Islam.
The ritual is an emulation of the Prophet Abraham's stoning of the devil at the three spots where it is said Satan tried to dissuade the biblical patriarch from obeying God's order to sacrifice his son, Ishmael.
In 2006, more than 300 pilgrims were killed in a stampede during the stoning ritual, the most dangerous of the hajj. More than 250 were killed in a similar incident in 2004.
The deaths prompted the Saudi authorities to invest billions of dollars in transport and other infrastructure to facilitate the movement of the huge numbers of people who take part.
After the stoning, pilgrims performed the final tawaf, or circumambulation, of the Kaaba, a cube-shaped structure in the middle of the Grand Mosque, Islam's most important shrine, in the holy city of Mecca.
Muslims believe the Kaaba -- which they call the "House of God" -- was built by Abraham 4,000 years ago.
Signup to our newsletter and follow us on Facebook and Twitter!
Thousands of pilgrims were later seen loading trucks with luggage and leaving their hotels in Mecca.
The majority of them make the 100-kilometre (60-mile) journey to Jeddah international airport to take flights back home.
Oil-rich Saudi Arabia deployed more than 100,000 troops to maintain the security of the pilgrims during the hajj.
The authorities declared this year's hajj a great success after it finished free of accident or disease.
There had been particular concern about the possible spread of the MERS virus, which has killed 60 people worldwide, 51 of them in the kingdom itself.
"Not a single case (of MERS) was detected," Health Minister Abdallah al-Rabia told reporters.
The overall number of pilgrims at this year's hajj was just under two million, sharply down on last year's 3.2 million.
Foreign pilgrims accounted for 1.38 million of them, compared with 1.75 million in 2012.
Officials said the smaller number contributed to the success.
The pilgrimage was monitored by more than 5,000 cameras installed at all holy sites, including 1,200 at the Grand Mosque, managed by the Command and Control Centre for Hajj Security.
Saudi Minister of Hajj Affairs Bandar Hajjar said on Wednesday that his ministry has been instructed by the king to work out a 25-year plan to ensure the smooth running of the pilgrimage.