Saudi Arabia said on Saturday that security forces had cleared hundreds of thousands of unregistered pilgrims from Makkah ahead of Hajj commencing next week.
Crowd management is a major concern during the annual pilgrimage which drew more than 1.8 million Muslims last year, according to official figures.
Those turned away in recent days from the holy city, home to the Grand Mosque, include 153,998 foreigners who travelled from abroad on tourist visas rather than the required visa, the official Saudi Press Agency said.
In addition, Saudi authorities have rounded up 171,587 others who are based in Saudi Arabia but are not residents of Makkah and did not have Hajj permits, SPA said.
Many seek to complete the rites through unofficial channels as obtaining formal permits and travel packages can be extremely costly, with limited quotas for pilgrims from each country.
Saudi Arabia is home to the holiest shrines in Islam at Makkah and Medinah.
Large crowds have proved hazardous in the past during the hajj, most recently in 2015 when a stampede during the "stoning the devil" ritual claimed up to 2,300 people in the deadliest-ever hajj disaster.
Fears of a repeat have spurred Saudi officials to crack down on off-the-books pilgrims.
More than 1.3 million registered pilgrims had arrived in Saudi Arabia for the hajj as of Saturday, authorities said on X.