IN JUNE 2009 Neil MacGregor, the director of the British Museum (BM), flew to Saudi Arabia, his first visit to the heart of the Islamic world. He wanted the blessing of the Saudi royal family.

Mr MacGregor and Venetia Porter, the BM's keeper of Islamic art, spoke to the chairman of the Saudi Commission for Tourism and Antiquities, Prince Sultan bin Salman (known locally as the “astronaut prince” for being the only Saudi to have travelled in space). They also met Princess Adila bint Abdullah, a daughter of the king and one of the few princesses with a public role in Saudi Arabia, and her husband, Prince Faisal bin Abdullah, the new minister of education. At each meeting they outlined in detail the BM's ambition: to put on the West's first big show about the haj, the annual holy pilgrimage to Mecca.

All three royals were enthusiastic, which meant the project also had the king's support. Conscious of the bashing that Islam had taken in the West since Saudi-born hijackers flew their planes into the twin towers in New York nearly a decade earlier, they saw the power of cultural diplomacy. A show that emphasised the ancient tradition of the haj, one of the five pillars of Islam, would be a source of pride for Muslims and a clear reminder of Saudi Arabia's pre-eminent position in the Islamic world.

But organising the show has posed considerable challenges. The BM had to deal with 40 individual lenders from the Netherlands to Timbuktu, numerous different government ministries in Saudi Arabia and a nervous Saudi embassy in London. The idea of portraying in a Western museum something as holy to Muslims as the haj took some getting used to, and there wasn't much to go on. Two shows—one on pilgrimage, in Christianity and Judaism as well as Islam, at the Ashmolean Museum in Oxford in 2006 and another on pilgrims' writings at the Islamic Arts Museum Malaysia in Kuala Lumpur in 2009—were the closest precedents. The potential for error or offence was considerable.

Terrified of being blamed if anything went wrong, conservative Saudi officials shied away from taking responsibility. Negotiations over the loan of antiquities from the earliest haj route, from Kufa (in present-day Iraq) to Mecca, proved especially complicated, as did agreeing what profile to give the sponsor, HSBC Amanah, on the exhibit labels. (For a bank to sponsor an exhibition about a religion that forbids charging interest was particularly delicate.) Even after the intervention of a royal aide—Faisal bin Muammar, director of the King Abdulaziz Public Library in Riyadh—it was only when the final shipment of loans left Saudi Arabia for London just before Christmas that the museum was certain the show would come off.

And what a show it is. Visitors are taken on a journey to the city Muslims call Makka al-Mukarrama (Mecca, the Blessed), just as pilgrims have done for hundreds of years and as Prince Charles will when he formally opens the exhibition later this month. A large black cuboid, hung with intricately woven Islamic textiles, rises at the heart of the show in the centre of the BM's circular reading room. It represents the ka'ba (pictured above), the black stone that the prophet Abraham is said to have built and which pilgrims circle seven times as part of the haj ritual.

Through the ages, pilgrims have journeyed to Mecca via several routes. Mansa Musa, the king of Mali, became famous throughout medieval Europe and the Islamic world when he travelled across the Sahara from Timbuktu to Cairo and then to Mecca in 1324, accompanied by 60,000 followers and 300 pounds of gold, which he distributed along the way. Millions more pilgrims have travelled by road from Istanbul and Damascus or by dhow and steamship from Singapore and Mumbai, tacking carefully around the coral outcrops of the Red Sea. A long maritime chart from about 1835 written in Gujarati, Hindi and English shows what a fraught journey it was.

At least they had charts. Before Islam Mecca had been an important site for pilgrims from north and central Arabia. They had many deities including Allah, but once a year, during a sacred month, they travelled, following the stars, to the city to worship Allah alone. Mecca became an important commercial centre. The revelation starting in 610 of Islam to the prophet Muhammad, with Allah as its only god, transformed Mecca into the holiest city in the Islamic world.

The exhibition concentrates on this earliest pilgrim route, the 900-mile (1,448-km) road from Kufa, where pilgrims gathered from Iraq, Iran and Central Asia before making the journey south to Mecca. In the late eighth century Zubaida, the wife of the Abbasid caliph, Harun al-Rashid, ordered the construction of wells along the route, as well as forts, beacons, milestones and resting places for the month-long journey across the desert. She went on the haj five times and gave her name, not just to the route itself, but also to the irrigation system known as the spring of Zubaida on the plain of Arafat, outside the city.

Muslims are obliged to go on the haj at least once in their lifetime. So many pilgrims want to make the journey that the Saudis now impose strict national quotas (calculated according to national populations) on pilgrims.

Once arrived, they begin their rituals: the changing into simple white clothes, the tawaf or circumambulation of the ka'ba, the drinking at the sacred Zamzam well, the prescribed running and collecting of pebbles, the shaving or cutting of one's hair and the renewed commitment to the principles of Islam. To most it is a transcendent experience. Muhammed Ali, the boxer, who made the haj in 1989, said afterwards: “I have had so many nice moments in my life. But the feelings I had standing on Mount Arafat on the day of the haj was the most unique.”

Rich as the BM exhibition is, much has inevitably been left out. Other than a maquette of the area around the ka'ba, there is little about how the site has grown or about the nightmarish logistics of welcoming nearly 3m pilgrims at a time to Mecca, nor about the horrific accidents that occasionally happen. A stampede caused more than 300 deaths in 2006, while in 1979 militants took over the grand mosque and were evicted by force. It would be interesting also to know more about the changes wrought by the quota system, which suddenly saw tens of thousands more Muslims from Indonesia and Nigeria where before they had come mostly from Saudi Arabia's Arabic-speaking neighbours. Little attention has been paid to the economic effects of the haj, in Saudi or in the pilgrims' homelands, and on how the pilgrimage is likely to develop in future. A small section at the end exhibits the contemporary art the pilgrimage has inspired. Each of these areas could be the focus of another show. Now the first big step has been taken, perhaps more will follow.

“Hajj: Journey to the Heart of Islam” will be at the British Museum from January 26th until April 15th