MECCA, Saudi Arabia — More than 2 million Muslims began the annual hajj pilgrimage at first light Sunday in Saudi Arabia, circling the cube-shaped Kaaba in Mecca that Islam's faithful face five times each day during their prayers.

The five-day hajj pilgrimage represents one of the world's biggest gatherings every year, and is required of all able-bodied Muslims once in their life.

The hajj offers pilgrims an opportunity to feel closer to God amid the Muslim world's many challenges, including the threat of violence and extremists in the Mideast and the plight of Myanmar's Muslim Rohingya minority.

Get Breaking News Delivered to Your Inbox

"We are very blessed by Allah to be in this place, and we pray to Allah to make the Islamic nations from the West to the East in a better situation," said Essam-Eddin Afifi, a pilgrim from Egypt. "We pray for the Islamic nations to overcome their enemies."

Muslims believe the hajj retraces the footsteps of the Prophet Muhammad, as well as those of the prophets Ibrahim and Ismail — Abraham and Ishmael in the Bible. Muslims believe God stayed the hand of Ibrahim after commanding him to sacrifice his son, Ismail. In the Christian and Jewish version of the story, Abraham is ordered to kill his other son, Isaac.

The Kaaba represents the metaphorical house of God and the oneness of God.

Muslims circle the Kaaba counter-clockwise seven times while reciting supplications to God, then walk between the two hills traveled by Hagar, Ibrahim's wife. Mecca's Grand Mosque, the world's largest, encompasses the Kaaba and the two hills.

A Muslim worshipper uses his cellphone to livestream the crowd circling around the Kaaba, Islam's holiest shrine, at the Grand Mosque in Saudi Arabia's holy city of Mecca on August 17, 2018. Getty

Before heading to Mecca, many pilgrims visit the city of Medina, where the Prophet Muhammad is buried and where he built his first mosque.

After prayers in Mecca, pilgrims will head to an area called Mount Arafat on Monday, where the Prophet Muhammad delivered his final sermon. From there, pilgrims will head to an area called Muzdalifa, picking up pebbles along the way for a symbolic stoning of the devil and a casting away of sins that takes place in the Mina valley for three days.

At the hajj's end, male pilgrims will shave their hair and women will cut a lock of hair in a sign of renewal for completing the pilgrimage. Around the world, Muslims will mark the end of hajj with a celebration called Eid al-Adha. The holiday, remembering Ibrahim's willingness to sacrifice his son, sees Muslims slaughter sheep and cattle, distributing the meat to the poor.

Maj. Gen. Mansour al-Turki, the spokesman of the Saudi Interior Ministry, told journalists Saturday that over 2 million Muslims from abroad and inside the kingdom would be taking part in this year's hajj.

Saudi Arabia's ruling Al Saud family stakes its legitimacy in part on its management of the holiest sites in Islam. King Salman's official title is the "Custodian of the Two Holy Mosques," at Mecca and Medina. Other Saudi kings, and the Ottoman rulers of the Hijaz region before them, all have adopted the honorary title

The kingdom has spent billions of dollars of its vast oil revenues on security and safety measures, particularly in Mina, where some of the hajj's deadliest incidents have occurred.

The worst in recorded history took place only three years ago. On Sept. 24, 2015, a stampede and crush of pilgrims in Mina killed at least 2,426 people, according to an Associated Press count.

The official Saudi toll of 769 people killed and 934 injured has not changed since only two days afterward. The kingdom has never addressed the discrepancy, nor has it released any results of an investigation authorities promised to conduct over the disaster.

Meanwhile, Saudi Arabia also faces threats from al-Qaida militants and a local faction of the Islamic State group. Days earlier, the Interior Ministry acknowledged arresting a Saudi wearing an explosive vest in the kingdom's central al-Qassim region who shot at security forces.

Meanwhile, a Saudi-led war in Yemen against Shiite rebels drags on without an end in sight. The rebels have fired over 150 ballistic missiles on the kingdom during a conflict that has seen Saudi airstrikes hit markets and hospitals, killing civilians.