In 1839, the Sublime Porte attempted to take back what it lost to the "de facto" autonomous, but "de jure" still Ottoman Eyalet of Egypt, but its forces were initially defeated, which led to the Oriental Crisis of 1840. Muhammad Ali Pasha had close relations with France, and the prospect of him becoming the Sultan of Egypt was widely viewed as putting the entire Levant into the French sphere of influence. As the Sublime Porte had proved itself incapable of defeating Muhammad Ali Pasha, the British Empire and Austrian Empire provided military assistance, and the second Egyptian–Ottoman War (1839–1841) ended with Ottoman victory and the restoration of Ottoman suzerainty over Egypt Eyalet and the Levant.