Carlos Mesa is to remain in office as Bolivian president, after Congress voted unanimously to reject his offer of resignation.
Carlos Mesa has approval ratings of above 50%
He offered to stand down on Monday, amid nationwide protests that he said had left Bolivia "ungovernable".
Bolivia's indigenous majority had staged a series of roadblocks and protests against his economic policies.
The vote came after a day of talks between Mr Mesa and Bolivia's main political parties.
Two of the three main blocs agreed to support him, but the BBC's Elliot Gotkine says the refusal of the main opposition party, MAS, to sign up to the agreement could yet complicate matters.
"I am willing to keep working with Congress," Mr Mesa told legislators after the vote, in a speech outlining a national "social pact".
"We have been given a new opportunity. I want Bolivians to support their president."
Mr Mesa announced that a law on taxing foreign energy firms would be passed quickly.
A referendum on regional autonomy and a constituent assembly to define a new constitution would also be established, he said.
The president called for ordinary Bolivians to take to the streets to show their opposition to roadblocks and protests.
Bolivia's 157 congressmen unanimously rejected Mr Mesa's resignation less than five minutes after gathering to vote.
As the news emerged, the centre of Bolivia's capital, La Paz, saw thousands of Mr Mesa's supporters fill the streets as negotiations on the "social pact" continued late into the evening.
They chanted: "Mesa - our friend! The people are with you!"
Mr Mesa, a political independent, came to power in October 2003 when his predecessor, Gonzalo Sanchez de Lozada, fled the country over nationwide protests in 2003 that left at least 60 people dead.
His term of office ends in 2007.
Mr Mesa's offer of resignation was widely interpreted as a political gamble.
Despite the protests, Mr Mesa still retain indigenous support
"I cannot continue governing while being besieged by a national blockade that strangles the country, " he said in his letter of resignation on Monday.
In a nationally broadcast address on Sunday, he said his period in office had been blighted by no fewer than 820 protests.
Among 26 foreign oil companies with contracts to exploit Bolivia's large natural gas and oil resources are Total (France), Petrobras (Brazil), British Gas, Exxon Mobil (US), Repsol (Spain) and PlusPetrol (Argentina).
Mr Mesa had come under pressure from the main leftist opposition to increase taxes on foreign gas and oil firms from 18% to 50%.
The president rejected the demands, saying the high levy would discourage foreign investment in South America's poorest country.