One of Britain's first package holidays was to Mecca, according to a new study published as millions of Muslims prepare to make the annual Hajj pilgrimage.

The Hajj - one of the five pillars of Islam - takes place this week, with Muslims from all over the world due to gather at the sacred site in Saudi Arabia.

But while its significance in the Islamic world is well known, it also became a major but lesser known feature of British imperial culture.

While modern customers are more likely to book a trip to Tenerife, back in the late 19th century Thomas Cook's premier package tour was the pilgrimage to Mecca, according to a study by Dr John Slight, a fellow at St John's College, University of Cambridge.

He found that in the 1880s the colonial government in India found itself under fire, with more of its Muslim subjects than ever before travelling to the Arabian Holy City.

Concerns over exploitation and insanitary conditions often involved in the journey had reached breaking point.

British authorities turned to Thomas Cook and Son, which became the official travel agents for the Hajj in a bid to improve conditions.

The company was called in by the government in 1886, after a scandal surrounding the near-sinking of a pilgrim ship.

The firm was given a contract to arrange tickets, train journeys, ships and other logistics enabling Muslims living in India, as subjects of the British Crown, to perform Hajj.

But the project was shortlived as by 1893 the firm had made such a loss that it chose to pull out.

John Mason Cook, Thomas Cook's son, remarked at the time: "Some government officials said I am powerless to make any improvement.

"I reminded them that government officials have been to a great extent powerless in relation to that pilgrimage."

Dr Slight found that Britain's stewardship of the Hajj started with controls to prevent disease, but soon expanded into a full-blown bureaucracy.

By the mid-to-late 19th century, the British authorities were increasingly obliged to manage the pilgrimage so as to be seen as a friend and protector of Islam.

One problem was that of "pauper" pilgrims who made the Hajj but could not afford to travel home.

The British paid for their repatriation and issued IOU forms - but these were rarely repaid.

"It was one of the most significant unintended consequences of Britain's rule over a large part of the Islamic world," Dr Slight said.

"Britain ended up facilitating the pilgrimage in an ultimately futile attempt to gain legitimacy among its Muslim subjects. Inadvertently, it ended up acting like a Muslim power."

His book, The British Empire And The Hajj, will be published next month.