Ouyahia is the most senior politician to be detained over graft allegations since mass protests forced President Bouteflika to step down in April. Protesters are calling for an overhaul of Algeria's political system.
Algeria's Supreme Court has ordered the detention of Ahmed Ouyahia in a corruption case, Algeria's state media reported on Wednesday.
Ouyahia, 66, is the most senior politician in the country to be jailed since protesters took to the streets earlier this year, calling for a new political system, improved living standards and the eradication of corruption.
Hundreds of people celebrated Ouyahia's detention outside the prison in an eastern suburb of Algiers, private TV channels showed.
The former prime minister, who left the government in March as part of the cabinet reshuffle, is being probed in a number of graft cases, including "awarding illegal privileges."
Abdelghani Zaalane, Ouyahia's transport minister, also appeared before the court on Wednesday. The two politicians are the latest senior Algerian politicians to be investigated for corruption.
Ouyahia is the leader of the Democratic National Rally (RND), Algeria's second largest party.
In February, mass protests broke out in Algeria, forcing former President Abdelaziz Bouteflika to resign on April 2.
Zaalane had been named campaign manager for Bouteflika for an April 18 presidential election, which was canceled as a result of the massive demonstrations.
But the protesters have maintained the pressure on the country's ruling elite. Several senior officials, including another former prime minister, Abdelmalek Sellal, and eight former ministers appeared in a court last month on suspicion of corruption.
Bouteflika's youngest brother, Said, and two former intelligence chiefs have also been arrested for "harming the army's authority and plotting against state authority."
Several prominent businessmen, some of them close to Bouteflika, have been detained pending trial.
What next for Algeria?
Algeria's Constitutional Council announced earlier this month that it would be "impossible" for the presidential vote to go ahead on July 4 because the only two candidates in the race had been rejected. No new date has been set for the vote.
The council added that it was now up to interim President Abdelkader Bensalah to set a date for a new vote. Bensalah had been appointed interim leader until July 9, but protesters say they want him gone.
On May 31, hundreds of thousands of demonstrators marched in the capital, Algiers, and other cities to demand his resignation, along with that of Bouteflika ally, Prime Minister Noureddine Bedoui.
Algeria's army chief Ahmed Gaed Salah has urged the judiciary to investigate all people suspected of being involved in graft.
shs/msh (AFP, Reuters)