In 1972, Ahmed Ouyahia joined the entry examination for the "École nationale d'administration" of Algiers. Having scored among the top three applicants, along with Ahmed Attaf, Ouyahia joined the École nationale d'administration and specialised in diplomacy.[1] He graduated in 1976 and did his military service from 1976 to 1978, at the El Mouradia compound of the Algerian Presidency where he was a member of the press relations team.[1]

In 1979, Ouyahia joined the ministry of foreign affairs and was assigned to the African affairs department.[1] In 1980 he was named as an advisor for foreign affairs to the ambassador of Algeria in Ivory Coast, where he served until 1982.[1] In 1982 he was assigned as a foreign affairs advisor to the head of the Permanent Mission of Algeria at the United Nations headquarters in New York.[1] In 1988 Ouyahia became the general director of the African department of the foreign affairs ministry.[1] From 1988 to 1989 Ouyahia was co-representative to the United Nations Security Council.[2] He was an advisor to the minister of foreign affairs from 1990 to 1991.[2]

He led the African department until 1991[1] when he was named as Algeria's ambassador to Mali and served in the post from 1992 to 1993.[2] There he helped negotiate a 1992 peace deal in the Malian Tuareg rebellion between the warring Malian government of Alpha Oumar Konaré and the Azawad Tuareg movement: the short lived "Pacte National" treaty. In August 1993, Ouyahia was called back to Algiers to serve in the government of Redha Malek as nndersecretary of state for African and Arab affairs, secretary of state for cooperation and Maghreb affairs.[1]

In April 1994 he was nominated as the cabinet director of President Liamine Zeroual,[2] where he was in charge of political affairs such as the negotiations with the leaders of the banned Islamic Salvation Front party (FIS) and the preparations for the 1995 presidential election, which the president won in November 1995. His role in as a member of the so-called "eradicator" faction, advocating all out war against the insurgency during the Algerian Civil War that killed more than 150,000 on both sides,[3] earned him criticism by some Western human rights groups.[2] He is particularly associated with the creation in the late 1990s of the GLD citizen militias ("Legitimate Defence Groups", "Groupes de légitime défense").[4][5]

In December 1995 Ouyahia was nominated as prime minister and held that position until December 1998,[1] when he resigned following the election of Abdelaziz Bouteflika to the presidency of Algeria. The economic condition of Algeria in the late 1990s, as well as a wave of public sector strikes, contributed to his increasing unpopularity as prime minister[6][7] and his December 1998 resignation. As well, opposition parliamentarians accused Ouyahia of rigging the 1997 elections.[8][9]

In 2000 Ouyahia was elected secretary general of the National Rally for Democracy (RND), which he had earlier helped to found.[2] He resigned from the post on 5 January 2013.[10]

A strong defender of the government, in February 2001, Ouyahia proposed new laws as justice minister which would have imposed a 3-year prison term for authors of articles or drawings deemed "defamatory" to political leaders.[11]

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 May 2003, 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,[1] until his resignation on 24 May 2006 amidst political arguments between Ouyahia's political party and Bouteflika's political party, the FLN.

Starting on 14 October 2003 and lasting through November, the National Council of Secondary and Technical Education Professors (CNAPEST) and the Secondary School Council of Algiers (CLA) went on strike over low wages. education minister Boubekeur Benbouzid, backed by prime minister Ahmed Ouyahia, refused to meet with representatives of either union because they were not officially recognized. Instead, the Government ordered the suspension of more than 300 teachers and threatened further sanctions. only after the officially recognized UGTA affiliate National Federation of Education Workers (FNTE) joined the strike did the agree to raise wages.[12]

The domestic press again asserted that his May 2006 resignation was due to public unpopularity after his opposition to public sector strikes, his opposition to a plan put forward by the rival FNL to raise salaries, and by his support for privatisation of industries.[13]

In June 2004, Ouyahia called Al-Jazeera television, recently closed indefinitely by his government, "a channel whose sole aim was to tarnish Algeria's image." The channel had broadcast several reports critical of the government the week prior to its closure.[14] From 1993 to 2000, around 4,000 men and women suddenly disappeared in Algeria after being arrested by security forces.[15] Ouyahia has been accused by Western Human rights groups of downplaying the number missing and criticised for claiming that "a large number of the so-called disappeared were in fact in the ranks of terrorist groups."[16][17]

Ouyahia has been widely credited with mediating a longstanding dispute between protesters leaders from his native Kabylie and the government. In 2005 the government took steps to defuse tensions with the Kabylie and address the concerns of regional leaders. In particular, prime minister Ahmed Ouyahia reached agreement on a number of Kabylie grievances with Arouch leader Belaid Abrika, who had been physically assaulted during a public protest rally and seriously injured in 2003 by members of government security services. The agreement dealt with economic and social concerns and made possible regional elections in November 2005.[18][19] Ouyahia made a number of visits to opposition leaders, and reached out in the Berber-language media for reconciliation.[20]

After some prominent involvement in international diplomatic meetings earlier in 2008, Ouyahia was again named Prime Minister by Bouteflika on 23 June 2008.[1] On this occasion, he pledged "to continue to apply the policy programme of the President of the Republic."[21] The foreign and domestic press commented on the sometime stormy relations between Ouyahia and Bouteflika, which did not have the same way of his Prime Ministership.[22] Ouyahia's term ended on 3 September 2012, and he was replaced by Abdulmalek Sellal.[23]

^Armed Conflicts Report, Algeria. Ploughshares (Canada). Update: January 2008. "... Disliked by the press and the population at large, Ouyahia is blamed not so much for the continuing massacres of civilians as for the decline in living conditions." quoting Le Monde 20 December 1998.

^ALGERIA: PREMIER QUITS. New York Times. 15 December 1998. "Opposition members accused Mr. Ouyahia of rigging the 1997 parliamentary elections in favor of the majority party, and demanded his resignation as a signal that the approaching elections would be fair. Mr. Ouyahia had been denounced for not turning around a declining economy, or ending attacks by radical Islamic guerrillas." Craig Pyes (NYT)

^Algeria: 2003. Country Reports on Human Rights Practices, United States Bureau of Democracy, Human Rights, and Labor. 25 February 2004

^Algeria’s new PM to revise constitution, hike pay. Ouyahia resigns after his intransigence in face of repeated strikes by teachers, vets, doctors, workers. Middle East Online. 25 May 2006"Daily newspaper Le Jeune Indépendant said that Ouyahia, who resigned on Wednesday night, had been scuppered by his own opposition to an increase in public salaries.The former president had become highly unpopular since he came out against the general salary increase proposed by the unions and supported by the FNL, led by Belkhadem, in January. Ouyahia's unpopularity was exacerbated by his intransigence in the face of repeated strikes by teachers, vets, doctors, and by workers who claimed their jobs were threatened by the privatisation of public sector organisations, which the former prime minister was determined to push through."