Burundi's parliament has elected a new president in the final step of a deal to end 12 years of war between Hutu rebels and the Tutsi army.
Pierre Nkurunziza has promised new peace talks
Former rebel leader Pierre Nkurunziza was the only candidate, after his FDD group won parliamentary elections.
He will be the first president chosen through democratic means since the start of the civil war in 1993. The vote follows five years of peace talks.
A small group of Tutsis has dominated Burundi since independence in 1961.
Under the terms of the deal agreed between the government and Hutu rebels, democracy will be balanced with guarantees for the Tutsi minority.
Peace talks priority
The BBC's Rob Walker in the capital, Bujumbura, says there are now real hopes that Burundi is finally turning the corner away from violence.
Mr Nkurunziza, 41, is to be sworn in on 26 August.
Although he was the only candidate, he received 151 of the 162 votes cast. There were nine votes against, one abstention and one unmarked paper.
Our correspondent says the new president will need to reassure Tutsis, some of whom are wary of rule by former Hutu rebels.
Mr Nkurunziza will also need to breathe life back into a shattered economy if he is to meet the growing expectations of Burundi's impoverished population, our correspondent says.
On the eve of Mr Nkurunziza's election, the last remaining rebel group, the National Liberation Forces (FNL) attacked a military base, leaving three soldiers and five rebels dead, the army said.
The FNL is a much smaller group than Mr Nkurunziza's Forces for the Defence of Democracy (FDD).
"There are indications that the FNL is planning to intensify attacks from now until the inauguration, just to show that it is still present on the ground and maybe put some pressure on the new government to talk to them," said army spokesman Maj Adolphe Manirakiza.
In a speech to parliament on Thursday, Mr Nkurunziza vowed to engage the FNL in peace talks.
"The first priority is to engage in talks with the FNL and to conclude hopefully a ceasefire agreement with that movement," he said.