The apostle John spent the final years of his life leading the church in Ephesus, and was buried nearby. In the early fourth century a small chapel was built over his grave, which was rebuilt into a large basilica during the reign of Emperor Justinian (AD 527-565).
This basilica was made of stone and brick in the shape of a cross, with six domes. The tomb of John was under the central dome.
It was used as a church until the invasion of the Turks in the 14th century, when it was converted into a mosque. It fell into ruins after a serious earthquake soon after.