Muslim pilgrims circled the Kaaba, Islam's holiest site, for a final time Tuesday, bringing to a close what may have been the largest ever hajj pilgrimage, passing without the deadly stampedes that have marred the event in the past.

Hundreds of thousands of pilgrims returned to Mecca from a holy site outside the city to perform the "farewell" circling of the Kaaba, the black stone cube that Muslims around the world face during daily prayers.

As they packed up to go, many then plunged into the nearby markets to buy mementos and gifts for people back home.

Tanveer Mustafa, from Britain, bought several jars to fill with water from Zamzam, a holy well nearby the Kaaba. The water is piped to numerous faucets around the Kaaba, where pilgrims crowded to fill cans, bottles and thermoses.

"I have four friends at home who asked me to bring them Zamzam water, so it's a jar for each of them," Mustafa said Monday night, before heading to the nearby city of Jiddah, a departure point for many pilgrims.

Most of the pilgrims did their farewell circuit around the Kaaba on Monday, but many waited until Tuesday to complete to rites.

This year's hajj took place at a time of crises around the Islamic world — particularly in Iraq — and Saudi authorities had warned against any political demonstrations during the five-day pilgrimage. But none took place — even when former Iraqi leader Saddam Hussein was executed on the third day of the pilgrimage, deeply dividing Arabs. Many Shiite pilgrims applauded his death, while many Sunni Arabs were angered.

The hajj also passed without a repeat of the deadly stampedes that have plagued the pilgrimage. Last year, 363 people were killed in a crush at the desert plain of Mina, where pilgrims carry out a symbolic stoning of the devil.

Many pilgrims praised new safety measures taken by Saudi authorities since the stampede. The Mina rites have long been the most dangerous of the hajj, because huge crowds of pilgrims must pass by three stone walls representing Satan and pelt each with pebbles, causing deadly logjams.

The pilgrims move along a long platform where the walls are located. After last year's stampede, the old platform was torn down and replaced by a larger one — a half-mile long and 80 yards wide, with more entrances and exits.

Pilgrims are able to pass over or under the platform to reach the walls — and over the next two years, Saudi authorities plan to build three more levels, allowing 5 million pilgrims to perform the rite in one day.

This year's hajj was likely the biggest ever, with authorities estimating that around 3 million pilgrims participated.

Saudi Arabia said 1.6 million pilgrims came from abroad through officially registered tour agencies, a rise of around 14 percent from the previous year. Their ranks were swelled by hundreds of thousands of pilgrims from inside the kingdom — many of them non-Saudis who came into the country but then stayed without a residence permit in order to perform the hajj.

During the hajj, pilgrims seek forgiveness for their sins and meditate on their faith, while tracing the steps of the Prophet Muhammad and Ibrahim — or Abraham, as he is known to Christians and Jews — who Muslims believe built the Kaaba.

Khaled Ansari, a Lebanese pilgrim, said the success of this year's hajj was a good sign after what he said had been "a bad year," for his own country — which saw a destructive war with Israel over the summer — and for much of the Middle East.

"Maybe this will recharge our batteries with faith and unity, and next year can be better," he said.