The 15th-century conversion of the cathedral into a mosque was the first historical controversy on this matter, which was not in line with the Islamic teachings. Islam lays down that the places of worship of two religions should be built at a considerable distance from each other. The Mosque of Umar in Jerusalem illustrates this principle of Islam. In 638 AD, the Second Caliph of Islam, Umar ibn al-Khattab was invited to Jerusalem by the city’s patriarch Sophronius. On reaching the city, he went to visit the Church of the Resurrection (or the Church of the Holy Sepulchre). By the time he reached the Church, it was time to pray. The Second Caliph asked Sophronius to guide him to a place where he could offer his prayers. Sophronius offered Umar ibn al-Khattab to pray inside the Church, but Umar declined and said that if he will pray inside the church today, it will set a precedent and may motivate the later-day Muslims to build a mosque on that spot. So Umar went outside the Church, picked up a stone and threw it at a distance. He offered his prayers at the spot where the stone fell. And as he predicted, later when the Ayyubids reached that region, they built a mosque at that same spot where Umar ibn al-Khattab had offered the prayers, known today as Mosque of Umar.