Ottomans terminated the Ramadanid administration in 1608 after the Celali rebellions and commenced ruling directly from Constantinople through an appointed Vali. In late 1832, Vali of Egypt, Muhammad Ali Pasha, invaded Syria, and reached Cilicia. The Convention of Kütahya that was signed on 14 May 1833, ceded Cilicia to the "de facto" independent Egypt. At the time of ceding, the Adana sanjak population of 68,934 hardly received any urban services. First neighborhood (Verâ-yı Cisr) east of the river was founded and Alawites brought here from Syria to work at the flourishing agricultural lands. İbrahim Paşa, the son of Muhammad Ali Paşa, demolished the Adana Castle and the city walls in 1836. He built the first canals for irrigation and transportation and also built a water system for the residential areas of the town, including wheels (tr:mavra) raising the water of the river for public fountains. After the Oriental crisis, the Convention of Alexandria that was signed on 27 November 1840, required the return of Cilicia to Ottoman sovereignty. The American Civil War that broke down in 1861, faltered the cotton flow to Europe and directed European cotton traders to fertile Cilicia. Adana had evolved to be a hub for cotton trade and one of the most prosperous cities of the Empire within decades. New Armenian, Turkish, Greek, Chaldean, Jewish and Alawite neighborhoods were founded, surrounding the formerly walled city. Adana–Mersin railway line was opened in 1886, connecting Adana to international ports through Port of Mersin. Further migration that had attracted by the large-scale industrialization, inflated the population of Adana to over 107,000 at the turn of the 20th century: 62,250 Muslims (Turks, Alawites, Circassians, Kurds), 30,000 Armenians, 8000 Chaldeans, 5000 Greeks, 1250 Assyrians, 500 Arab Christians and 200 internationals.