Alergia's parliament appointed the chairman of the upper house, Abdelkader Bensalah, as the interim president on Monday, state TV reported.
Mr Bensalah will lead the country until new elections are held, according to the North African country's constitution. His election as interim president follows constitutional rules but goes against the demands of demonstrators, who have pushed for him and other top politicians to stand down.
"We must work to allow the Algerian people elect their president as soon as possible," Mr Bensalah told the parliament.
"I want to work towards fulfilling the interests of the people," he said on taking up the 90-day interim presidency.
"It's a great responsibility that the constitution demands of me."
Under Algeria's constitution, Mr Bensalah will lead the country for the next 90 days.
He is replacing Abdelaziz Bouteflika, who resigned on April 2 after weeks of protests calling for him to step down.
Protests erupted in the North African country after Mr Bouteflika announced he was running for a fifth term in office. The president had rarely been seen in public since he suffered a stroke in 2013.
Earlier this month Mr Bouteflika resigned, but the protests have not abated. Instead, there have been calls for a complete overhaul of the political system, which they say is too close to big business and military elite.
Opposition parties refused to back Mr Bensalah's election and boycotted the session, as hundreds of students protested against him in Algiers.
"Resign Bensalah!" they chanted outside the main post office, which has become the focal point of weeks of mass protests in the capital.
Ahead of the parliamentary session, an editorial in pro-government daily El Moudjahid on Tuesday suggested Mr Bensalah should step aside from the presidential post.
He is not only "not tolerated by the citizen movement, which demands his immediate departure, but also by the opposition" and various political groups in both houses of parliament, the newspaper said.