Bolivia's Supreme Court head, Eduardo Rodriguez, has been sworn in as president, paving the way for an early election aimed at ending unrest.
The new president hopes the protests will now die down
Congress endorsed the caretaker leader late on Thursday, after accepting the resignation of President Carlos Mesa.
Mr Rodriguez promised to call a presidential election soon.
He assumed the presidency after the speakers of both houses of Congress waived their constitutional right to become head of state.
Hours earlier, the army shot dead a miner - the first fatality in a month of protests over Mr Mesa's handling of the country's gas reserves.
The mainly left-wing and indigenous protesters are demanding the nationalisation of the industry and constitutional reforms to give greater rights to the country's impoverished highlanders.
Mr Rodriguez is Bolivia's third president in less than two years.
His inauguration and the prospect of an election was hailed by protesters, who have been holding daily demonstrations and blockades since last month.
"Bolivia deserves better days," Mr Rodriguez told deputies.
"I am convinced that one of my tasks will be to begin an electoral process to renew and continue building a democratic system that is more just."
Under the constitution, an election must be held be held by the end of the year.
Mr Mesa said on Monday that he would step down as president.
The next in line would have been Senate Speaker Hormando Vaca Diez, but protesters blockaded Thursday's parliament session to prevent his appointment.
Mr Vaca Diez - seen as a representative of the business elite - declined the post, as did the head of the lower house. That meant the presidency passed to the head of the Supreme Court.
Some protesters tried to kick away police gas canisters
The BBC's Elliott Gotkine in Bolivia's main city, La Paz, says Mr Rodriguez is untainted by politics and seen as the only man capable of ending the unrest that was tearing the country apart.
Demonstrators in La Paz have been celebrating by setting off thunderous charges of dynamite.
The mainly peaceful protests turned violent on Thursday when Coro Mayta, a miner union leader, was shot dead by a soldier near Sucre, where the Congress session was being held.
He was on board a bus full of protesters who the military say attacked a checkpoint.
There were clashes in Sucre after miners entered the city despite a heavy deployment of security forces aimed at sealing it off.
La Paz has been cut off by weeks of road blockades that has led to shortages of food and fuel.
The protests erupted last month after a law was passed imposing taxes on foreign companies that have invested in Bolivia's gas reserves, thought to be the second-largest in South America.
The protesters said the law did not go far enough and called for the gas industry to be nationalised.
They oppose demands from Bolivia's resource-rich eastern provinces for greater autonomy and more foreign investment.
Mr Mesa came to power 19 months ago after his predecessor was forced out by similar protests over energy.