In 1840, Egypt was forced by Palmerston to return Crete to direct Ottoman rule. Mustafa Naili Pasha angled unsuccessfully to become a semi-independent prince but the Cretans rose up against him, once more driving the Muslims temporarily into siege in the towns. An Anglo-Ottoman naval operation restored control in the island and Mustafa Naili Pasha was confirmed as its governor, though under command from İstanbul. He remained in Crete until 1851 when he was summoned to the capital, where at a relatively advanced age he pursued a successful career. Religious tensions erupted on the island between Muslims and Christians and the Christian populations of Crete revolted twice against Ottoman rule (in 1866 and in 1897). In the uprising of 1866, the rebels initially managed to gain control of most of the hinterland although as always the four fortified towns of the north coast and the southern town of Ierapetra remained in Ottoman hands. The Ottoman approach to the "Cretan question" was that, if Crete was lost, the next line of defense would have to be the Dardanelles, as indeed it was the case later. The Ottoman Grand Vizier, Mehmed Emin Aali Pasha arrived in the island in October 1867 and set in progress a low profile district-by-district reconquest of the island followed by the erection of blockhouses or local fortresses across the whole of it. More importantly, he designed an Organic Law which gave the Cretan Christians equal (in practice, because of their superior numbers, majority) control of local administration. At the time of the Congress of Berlin in the summer of 1878, there was a further uprising, which was speedily halted through the adaptation of the Organic Law into a constitutional settlement known as the Pact of Halepa. Crete became a semi-independent parliamentary state within the Ottoman Empire under a Greek Orthodox Governor. A number of the senior "Christian Pashas" including Photiades Pasha and Adossides Pasha ruled the island in the 1880s, presiding over a parliament in which liberals and conservatives contended for power. Disputes between these led to a further insurgency in 1889 and the collapse of the Pact of Halepa arrangements. The international powers allowed the Ottoman authorities to send troops to the island and restore order but the Sultan Abdulhamid II used the occasion for ruling the island by martial law. This action led to international sympathy for the Cretan Christians and to a loss of