Many of the retreating IMU members were sheltered by the local militant commander Baitullah Mehsud, and when Mehsud turned against the Pakistani state and formed the Tehrik-i-Taliban Pakistan (TTP) in 2007, the IMU cooperated closely with him. The alliance between the two groups continued after Hakimullah Mehsud succeeded Baitullah as TTP leader in 2009, the IMU and the Tehrik-i-Taliban Pakistan carried out joint attacks on the Pakistani State and eventually formed a combined unit called Ansar al-Aseer, with the goal of freeing militant Islamist prisoners held in Pakistani prisons. Close ties were also formed with the militant Haqqani Network following the August 2009 killing of Yuldashev in a US drone strike, as the IMU's new leadership relocated the group to the Haqqani strongholds of Mir Ali and Miranshah in North Waziristan.