Nearly two million Muslims have set off from Mecca in Saudi Arabia to the valley of Mina as the annual Hajj pilgrimage gets under way.

The pilgrims walked or boarded buses to Mina, 5km east of the holy city, to begin tracing the journey made by the Prophet Mohammed more than 1,400 years ago.

Most of the pilgrims are expected to spend the day known as Yawm at-Tarwiya at Mina, an optional ritual, while others will head straight to Mount Arafat.

On Thursday and Friday all pilgrims will return to Mina for the ritual stoning of the three pillars that represent the devil and evil.

Those staying in Mina on Monday will spend the day praying and meditating, sleeping at night in tents before heading further south to Mount Arafat.

Security teams have been deployed to control and guide the moving mass of people, with ambulances and medics on standby.

Saudi Arabia has made huge efforts to try to smooth the path of pilgrims during the Hajj, which has seen periodic catastrophes due to crushing.

Mina was the site of the deadliest incident in July 1990, when a total of 1,426 pilgrims were trampled or asphyxiated in a stampede in a tunnel.

Last year in Mina, 364 people were killed in a stampede at the entrance of the Jamarat Bridge, from which the stoning of the pillars takes place.

This year, a third level has been added to the bridge to ease the flow and Saudi officials say the crossing can now handle more than 200,000 people every hour.

Among this year's pilgrims is Iranian President Mahmoud Ahmadinejad, who was invited by Saudi King Abdullah. 

He will join other pilgrims in the sacred rituals, which include walking counter-clockwise seven times around the Kaaba, the cube-shaped structure at the Grand Mosque in Mecca.

Mr Ahmadinejad's pilgrimage has an added significance because of the sometimes strained relations between largely Shia Iran and Sunni Saudi Arabia.