Ouyahia served as the Minister of State for Justice from 1999 to 2002 in Bouteflika's first government. During this time Ouyahia was assigned the task of securing a peace deal in the war between Ethiopia and Eritrea by Bouteflika, who was also the president of Organisation for African Unity in 2000. Ouyahia worked in conjunction with Anthony Lake, National Security Advisor to President Bill Clinton of the United States, and a peace deal was secured and signed in Algiers in December 2000.