He was elected for a fourth time to National Assembly in 2002 as a member of Pakistan Peoples Party (Parliamentarians), but later shifted his loyalty to become PPPP (Patriot) and then joined the Pakistan Muslim League (Q). Sher Afgan Niazi helped President of Pakistan Pervez Musharraf to oust, detain and then replace the judges of the Supreme Court in 2007 and also supported Musharraf regime's military operation at Lal Masjid, Islamabad. On 18 February 2008, he lost the general election to an independent candidate, Humair Hayat Khan Rokhri. On April 8, 2008 he was pelted with rotten eggs and attacked in Lahore, Punjab by the lawyers protesting against his support for dismissing of Supreme Court judges and Lal Masjid operation. That attack was strongly protested for days in his home town.