Bolivian lawmakers surprised the nation late Thursday when they announced they had accepted the resignation of President Carlos Mesa and selected his successor. The selection of Eduardo Rodriguez clears the way for early elections.

In a late-night session of Congress, Bolivian lawmakers accepted the resignation of President Carlos Mesa and selected Supreme Court President Eduardo Rodriguez to assume the presidency. Mr. Rodriguez was third in line to assume the presidency. Senate President Hormando Vaca Diez and Congress President Mario Cossio Cortez both declined the position.

In an early-morning inaugural address to lawmakers and Bolivians, the newly sworn in president thanked leaders for their show of faith in him and said Bolivia had a way to go to repair the damaged nation.

"We must now work to restore the republic," said President Rodriguez

Mr. Mesa's resignation and the naming of Mr. Rodriguez as president is intended to end weeks of crippling protests and open the way for elections within six months. In his address, President Rodriguez said he would call early elections, but did specify a date.

Mr. Mesa, who came to power in 2003 after his predecessor was ousted during bloody popular protests, had urged early elections after offering his resignation.

Bolivia has been hampered for nearly a month by protests over the government's handling of the gas industry and calls for its nationalization. Protesters also want a rewritten constitution giving more government representation to Bolivia's indigenous population.

Clashes between Bolivian protesters and police left one demonstrator dead on Thursday.