After Ali's assassination in 1807, his nephew Sulayman Pasha the Little took over the government. Inclined to curtail provincial autonomies, Sultan Mahmud II (1808–39) made his first attempt to oust the Mamluks from Baghdad in 1810. Ottoman troops deposed and killed Sulayman, but again failed to maintain control of the country. After yet another bitter internecine feud in 1816, Sulayman's energetic son-in-law Dawud Pasha ousted his rival Said Pasha (; 1813–16) and took control of Baghdad. The Ottoman government reluctantly recognized his authority.
