The president had become increasingly isolated
Bolivian President Gonzalo Sanchez de Lozada has resigned after weeks of violent anti-government protests.
Vice-President Carlos Mesa was sworn in to serve out the president's term, due to end in 2007.
In a letter read out by the secretary of the Congress in La Paz, President Sanchez de Lozada said he hoped his resignation would help to solve Bolivia's problems.
A huge popular uprising against his free market policies - including plans to export natural gas to the United States and Mexico - has left at least 70 people dead.
A respected journalist and political
independent, Mr Mesa immediately pledged to hold "a binding referendum" on exploitation of Bolivia's natural gas.
He also addressed the calls of Indian leaders for early elections, proposing that his mandate be shortened.
Mesa promised a referendum on gas - the issue that sparked the riots
"Bolivia is still not a country of equals. We must understand our peoples, our (indigenous) Quechuas and Aymaras,"
he told the Congress.
Wearing the presidential sash and
reading from a prepared speech, he said it was time for
"reparations" for the indigenous majority that led the wave of
protests against Mr Sanchez de Lozada.
The Information Ministry said the former president was now in the city of Santa Cruz with his family.
Congress had convened an emergency session to discuss the crisis.
As the resignation letter was being read out, some lawmakers shouted "murderer!"
For a fifth consecutive day tens of thousands of students, miners and farmers - most of them Indians - marched through Bolivia's main city La Paz, calling on the president to go.
Many brandished sticks of dynamite as they passed burning barricades.
Mr Sanchez de Lozada was seen as
out of touch with the poverty-stricken Indian population. The US-educated millionaire mining magnate, who speaks Spanish with an American accent, is nicknamed "gringo".
He took office in August 2002 after a bitter contest against his top rival, leftist Evo Morales, who led the protests that toppled him on Friday.
As news of the president's departure spread there were celebrations in the streets.
Mr Morales said demonstrators in nearby El Alto had taken control of the airport in an attempt to prevent Mr Sanchez de Lozada from leaving the country.
But Mr Morales said the protests would now end.
Support ebbs away
A key coalition partner of the embattled president withdrew its support for the government on Friday.
Manfred Reyes Villa, head of the centre-right New Republican Force (NFR) said: "There's nothing left to do but leave (the government). This can't go on."
Thousands of Bolivians marched through the streets of La Paz
The BBC's Elliott Gotkine, in La Paz, says the withdrawal of the NFR's support meant Mr Sanchez de Lozada's position was untenable.
Vice-President Mesa had already withdrawn his support for the president's policies and Minister of Economic Development Jorge Torres Oblea had already resigned.
Meanwhile, the US military is sending a small team of security specialists to the American embassy in Bolivia to assess the situation in the country.
La Paz paralysed
Friday's demonstration in La Paz was one of the biggest protests since the crisis over the gas exports began more than a month ago, with around 50,000 people taking part.
The protests have left much of La Paz paralysed after weeks of blockades. There is little food or fuel, pharmacies are running out of basic medicines and there is no money in cash machines, Reuters reports.
The Bolivian president had already been forced to postpone the controversial gas export scheme until 31 December.
But the opposition rejected an offer of a referendum on the project, saying it would accept nothing less than his resignation.