The king of U.S. ally Saudi Arabia has invited Iranian President Mahmoud Ahmadinejad to attend this year's hajj pilgrimage in the Muslim holy city of Mecca, Iranian media reported on Wednesday.

The invitation marks the first time an Iranian president was officially invited to take part in the annual pilgrimage, starting later this month, Iran's official IRNA news agency said.

Like other Gulf Arab states, Sunni Muslim Saudi Arabia has long been wary of its large Shi'ite Muslim neighbor and shares Western concerns about Tehran's nuclear ambitions.

"Saudi King Abdullah has formally invited President Mahmoud Ahmadinejad to take part in this year's hajj ceremony," Iran's ambassador to Saudi Arabia, Mohammad Hosseini, was quoted as saying by state television.

The five-day ritual is expected to begin on Dec. 18.

On Tuesday, Ahmadinejad said he would take part in the hajj if formally invited. Last week he became the first Iranian president to attend a summit of Saudi Arabia and five other Gulf Arab states.

It was not clear whether the 51-year-old had attended the hajj before. A duty for every Muslim at least once in a lifetime, the grueling ritual is one of the world's biggest displays of mass religious devotion and is held under tight security.

At least 1.5 million people are expected to arrive from abroad in Mecca, where pilgrims follow a route around the mountains in line with a tradition established by the Prophet Mohammed.

In 1987, more than 400 people, mostly Iranians, died in clashes with Saudi security forces at an anti-U.S. and anti-Israel rally in Mecca.