In 1831, Mehmet Ali, the ruler of Egypt, sent his army, led by his eldest son, Ibrahim Pasha, to occupy Bilad al-Shām (The Levant), which was under the rule of the Ottoman Empire. Ibrahim succeeded in occupying Jerusalem and the coastal regions of Palestine and Lebanon, most notably, Acre, after withstanding a severe siege, and Haifa, which was later used as a primary military base. Ibrahim Pasha's army was assisted by the European officers, who in return, helped increasing the Jewish influence in the region, and was also assisted by Suleiman Pasha, used to be known as Colonel Joseph Sève, who helped building the Egyptian army on the European model. Influenced by his father, Ibrahim Pasha imposed military conscription on the newly occupied territories, disarmed the population and raised taxes. Consequently, Palestinians questioned the legitimacy of the Egyptian occupation and provoked revolts against the rule of Mehmet Ali and his son.
In the spring of 1834, the rebellion against the Egyptian rule in Palestine spread from the Galilee in the north, to Gaza and the hills of Hebron (al-Khalīl) in the south. The rebels scored initial victories that compelled Ibrahim Pasha to withdraw to Jaffa and request reinforcements from Mehmet Ali. As soon as reinforcements arrived, Ibrahim Pasha waged military campaigns in in the hills of Jerusalem, Nablus and Hebron. Although the Egyptian army succeeded in putting the uprising down within a few months, Mehmet Ali was not satisfied that he pursued the rebels who had fled to the Karak region east to the Jordan River and executed the most prominent rebel leaders, such as, al-Madi, al-Jarrar, Qasim al-Ahmad, al-Samhan, Al-'Amr and others. He also exiled the Palestinian Muslim scholars (Ulama) and notables from Jreusalem, Nablus, Nazareth and Hebron who had supported the rebellion, including those who did so secretly, without active participating.
Granting a permission from Mehmet Ali, a British vice-consulate was established in Jerusalem in 1838, and in 1841, it was upgraded to the status of consulate. In 1840, Palmerston, the British Minister of foreign affairs, wrote to his British ambassador in Istanbul to convince the Ottoman Sultan that Britain believes that the time is ripe to open Palestine for Jewish immigration. The main purpose of the British consulate was to facilitate the Jewish immigration into Palestine and grant protection to the future Jewish settlers.