Later in his reign, Mahmud became involved in disputes with the Wāli of Egypt and Sudan, Muhammad Ali, who was technically Mahmud's vassal. The Sultan had asked for Muhammad Ali's help in suppressing a rebellion in Greece, but had not paid the promised price for his services. In 1831, Muhammad Ali declared war and managed to take control of Syria and Arabia by the war's end in 1833. In 1839, Mahmud resumed the war, hoping to recover his losses, but he died at the time news was on its way to Constantinople that the Empire's army had been defeated at Nezib by an Egyptian army led by Muhammad Ali's son, Ibrahim Pasha.