The earliest possible reference to Dhat al-Hajj was by the 9th-century geographer al-Idrisi, who described the site as a settlement named Damma.
Historian Alois Musil identified Damma (or Dimneh) with Dhat al-Hajj, but archaeologist Andrew Petersen asserts Musil's claim to be speculative and unreliable.
According to Petersen, the 13th-century geographer Yaqut al-Hamawi's mention of a site named "Dat al-Hajj" between Syria and Medina is more likely to be the first time Dhat al-Hajj was mentioned in the historical record.
Its name derives from its location as a rest and watering stop for pilgrim caravans making the Hajj to Mecca and Medina.
The Maghrebi traveler Ibn Batutah mentions the site about a century later, during Mamluk rule (1260–1517), while performing his Hajj, noting that it consisted of "two shallow wells with water from below but no building".
Syrian historian Abu'l-Fida noted that in 1313, Dhat al-Hajj was the site of an attack by Banu Lam tribesmen against a group of merchants heading for Tabuk to trade with Muslim pilgrims returning to Syria.
The merchants, twenty of whom were killed, and their guards forced back the Bedouin tribesmen and captured eighty of their camels.

The Ottoman Empire annexed the Hejaz region in 1517.
In 1559, Sultan Suleiman the Magnificent had forts built at Dhat al-Hajj and other way-stations on the Hajj route, namely al-Qatranah, Ma'an and Tabuk.
The inscription above the fort's gateway records that the fort at Dhat al-Hajj was completed in 1563.
The Sufi traveler Abd al-Ghani al-Nabulsi passed Dhat al-Hajj during his 1694 pilgrimage and noted that it had a reservoir guarded by troops from Syria.
In 1706, the western walls and gateway began to collapse.
Two years later, the Sufi traveler Murtada al-Alawan described the building as having been destroyed by the Bedouin tribesmen and reported that the amir al-hajj (caravan commander) climbed its ruined walls and announced his intention to rebuild the fort.
The Banu Sakhr and its allies launched a massive raid in 1757 against the Hajj caravan near Dhat al-Hajj, and at al-Qatranah and al-Ula, during which 20,000 pilgrims were killed or died of thirst or starvation.
The fort had apparently been repaired by 1779 when a traveler's account did not mention it being destroyed and noted the abundant water sources in its vicinity.
At the time, the fort was controlled by Bedouin tribesmen from the Banu Salim.

In the early 19th century, John Burckhardt visited Dhat al-Hajj and remarked that it was surrounded by an abundance of fruitless date palms.
A formal inspection of the Dhat al-Hajj fort was carried out under the auspices of the Ottoman viceroy of Egypt, Muhammad Ali Pasha.
The report noted that the fort was in good condition and contained a cistern that was supplied with water by a spring within the fort's walls and via a canal by a spring located some distance from the fort.
Charles Doughty gave the first detailed European description of the fort in the late 19th century, during which he reported that the Hajj had "so much ... diminished from its ancient glory".
The Rubillat branch of the Banu Atiya tribe dominated the vicinity of Dhat al-Hajj at that time.
The earliest possible reference to Dhat al-Hajj was by the 9th-century geographer al-Idrisi, who described the site as a settlement named Damma. Historian Alois Musil identified Damma (or Dimneh) with Dhat al-Hajj, but archaeologist Andrew Petersen asserts Musil's claim to be speculative and unreliable. According to Petersen, the 13th-century geographer Yaqut al-Hamawi's mention of a site named "Dat al-Hajj" between Syria and Medina is more likely to be the first time Dhat al-Hajj was mentioned in the historical record. Its name derives from its location as a rest and watering stop for pilgrim caravans making the Hajj to Mecca and Medina. The Maghrebi traveler Ibn Batutah mentions the site about a century later, during Mamluk rule (1260–1517), while performing his Hajj, noting that it consisted of "two shallow wells with water from below but no building". Syrian historian Abu'l-Fida noted that in 1313, Dhat al-Hajj was the site of an attack by Banu Lam tribesmen against a group of merchants heading for Tabuk to trade with Muslim pilgrims returning to Syria. The merchants, twenty of whom were killed, and their guards forced back the Bedouin tribesmen and captured eighty of their camels.
The Ottoman Empire annexed the Hejaz region in 1517. In 1559, Sultan Suleiman the Magnificent had forts built at Dhat al-Hajj and other way-stations on the Hajj route, namely al-Qatranah, Ma'an and Tabuk. The inscription above the fort's gateway records that the fort at Dhat al-Hajj was completed in 1563. The Sufi traveler Abd al-Ghani al-Nabulsi passed Dhat al-Hajj during his 1694 pilgrimage and noted that it had a reservoir guarded by troops from Syria. In 1706, the western walls and gateway began to collapse. Two years later, the Sufi traveler Murtada al-Alawan described the building as having been destroyed by the Bedouin tribesmen and reported that the amir al-hajj (caravan commander) climbed its ruined walls and announced his intention to rebuild the fort. The Banu Sakhr and its allies launched a massive raid in 1757 against the Hajj caravan near Dhat al-Hajj, and at al-Qatranah and al-Ula, during which 20,000 pilgrims were killed or died of thirst or starvation. The fort had apparently been repaired by 1779 when a traveler's account did not mention it being destroyed and noted the abundant water sources in its vicinity. At the time, the fort was controlled by Bedouin tribesmen from the Banu Salim.
In the early 19th century, John Burckhardt visited Dhat al-Hajj and remarked that it was surrounded by an abundance of fruitless date palms. A formal inspection of the Dhat al-Hajj fort was carried out under the auspices of the Ottoman viceroy of Egypt, Muhammad Ali Pasha. The report noted that the fort was in good condition and contained a cistern that was supplied with water by a spring within the fort's walls and via a canal by a spring located some distance from the fort. Charles Doughty gave the first detailed European description of the fort in the late 19th century, during which he reported that the Hajj had "so much ... diminished from its ancient glory". The Rubillat branch of the Banu Atiya tribe dominated the vicinity of Dhat al-Hajj at that time.
Dhat al-Hajj