In June 2002, following the defeat of the RND in the 2002 parliamentary election, Ouyahia resigned and was nominated in the next government as Minister of State and Special Representative of the President, an honorary position entailing no governing power. In July 2004, Ouyahia was nominated as Prime Minister for a second time, following a political crisis between President Bouteflika and Prime Minister Ali Benflis, who was dismissed. Ouyahia served in the post for three years, until his resignation on 24 May 2006 amidst political arguments between Ouyahia's political party and Bouteflika's political party, the FLN.