Saint Gaudentius of Brescia (+ 410) had gone on a pilgrimage to the Holy Land from Italy. On his way to Jerusalem he visited Caesarea, where two nuns, nieces of Basil the Great, gave him portions of the relics of the Holy Forty Martyrs of Sebaste. With these he dedicated a chapel in the Church of the Holy Sepulchre in Jerusalem to the Holy Forty Martyrs. He wrote: "God has given me a share of these venerable relics, and granted me to found this church in their honor."
This chapel is located today in the lowest story of the thirteenth-century bell tower, and was formerly the Monastery of the Trinity wherein were buried the patriarchs of Jerusalem. The present chapel dates back to the restoration of the buildings under Constantine Monomachos in the eleventh century. The story below, however, further shows that there was a chapel dedicated to the Forty Martyrs before this time.
The story of the building of the cupola over the Church of the Anastasis is also related to the Holy Forty Martyrs. As narrated by the annalist Eutychius, Patriarch Thomas of Jerusalem (809-829) saw the Forty Martyrs in a dream come forth in procession from a place at the side of the Anastasis (perhaps their chapel), ascend its walls, and take their stand in a circle at the summit, bowing their bodies and extending their arms inwards, forming a dome. He interpreted this as a message from God, bidding him to erect a cupola over the Anastasis. For this reason, Patriarch Thomas ordered forty large trunks of cedar and fir from Cyprus, and from these the cupola was built. In honor of the Forty Martyrs, Patriarch Thomas had a memorial altar built for them, which still exists today in the Church of the Holy Sepulchre. The construction of this cupola seems to have angered the Muslim authorities however, for they accused the Patriarch of constructing it higher than the Dome of the Rock. For this the Patriarch was thrown into prison, where he awaited execution. He escaped execution by paying a Muslim 1,000 dinars in exchange for a secret to escape. The secret was to lay the burden of proof on the Muslim authorities to prove the Anastasis was now loftier than the Dome of the Rock than before construction. Since there were no measurements from before the construction, there was no way to prove it, so he was set free.