LA PAZ, Bolivia (CNN) -- After weeks of enduring cajoling and threats that culminated in a hunger strike by President Evo Morales, Bolivia's congress on Tuesday approved a law allowing him to run for re-election in December.
Evo Morales on hunger strike at the presidential palace in Bolivia's capital, La Paz.
Bolivia's first indigenous president credited his five-day hunger strike for the decision, which came after an all-night debate.
"That effort has not been in vain," the leftist leader said as he approved the law, which calls for general elections to be held on December. 6.
The congress also approved a new census, seven parliamentary seats to be reserved for representatives of indigenous villages, and a referendum on autonomy for five resource-rich eastern regions and the eastern province of Gran Chaco.
It also set April 4, 2010, for regional and municipal elections.
For the opposition, the requirement of a new electoral census and tighter rules regarding who gets to vote was an important victory.
"It will give to all of us the assurance that our vote counts, that our vote will not be manipulated and that, therefore, we will define our future and the future of Bolivia," said Oscar Ortiz, a senator with the opposition Democratic Power party.
But Jose Antonio Quiroga, a political analyst, predicted that the national electoral court will face big difficulties in deciding how the new census will affect who gets to vote -- both inside and outside the country.
"That's an enormous job that must be decided not only by the electoral court, but the Office of Civil Registry, the National Police or perhaps the office of personal identification, which is where I believe the biggest problems will emerge," he said.
The approval of the electoral law marked the end not only to days of political tension but to the hunger strike by Morales, who reportedly carried out an 18-day hunger strike in 2002 -- when he was expelled from Congress.