In 1099, the Crusaders captured Jerusalem, setting up the Kingdom of Jerusalem and establishing a Latin hierarchy under a Latin Patriarch, and expelling the Orthodox Patriarch. The Latin Patriarch resided in Jerusalem from 1099 to 1187, while Greek Patriarchs continued to be appointed, but resided in Constantinople. In 1187, the Crusaders were forced to flee Jerusalem, and the Orthodox Patriarch returned to Jerusalem. The Catholic Church continued to appoint Latin Patricarchs, though the office holder resided in Rome until 1847, when they were permitted to return to the Middle East by the Ottoman authorities.