A replacement fleet was built for the First Egyptian-Ottoman War in 1831, and landed troops at Jaffa in support of the main Egyptian army marching into Syria. In the Second Egyptian–Ottoman War in 1839, following Egyptian victory in the Battle of Nezib, the Ottoman fleet sailed to Alexandria and defected to the Egyptian side. However, these victories provoked decisive European intervention to support the Turks, and while Muhammad Ali's dynasty continued to reign, Egypt ended up being transformed into a British protectorate until being granted independence in 1921.