The move comes hours after the stroke-afflicted president, Abdelaziz Bouteflika, fired the Prime Minister Abdelmadjid Tebboune, who held the position for just three months. The presidency statement gave no reason for the change.
Ouyahia, 65, served three terms as prime minister, the first being in the 1990s when Algeria was battling an Islamist insurgency. Most recently he was Bouteflika’s chief of staff.
He is the leader of the National Rally for Democracy, a party close to the presidency that increased its number of seats in recent parliamentary election.
A career diplomat, he also served as Minister of Justice, and is considered by Western observers to be close to the military of Algeria and a member of the “eradicator” faction in the 1990s civil war against Islamist militants.
Ouyahia has been widely credited with mediating a longstanding dispute between protesting leaders from his native Kabylie and the government.
The North African OPEC state is in the middle of economic reforms to cope with lower world oil prices. President Abdelaziz Bouteflika, 80, has rarely been seen in public since he suffered a stroke in 2013.