Lawmakers in the Solomon Islands have elected a new prime minister, almost three weeks after an election.
The new leader is the veteran politician Danny Philip.
Ballots were cast in the mostly Melanesian country of 600,000 people on 4 August but negotiations to choose a leader were protracted.
Senior government officials had voiced concern that the vote could spark the sort of unrest that marred the last election four years ago.
But the capital, Honiara, remained calm in the wake of the announcement of the new leadership.
In 2006, residents unhappy with the election of leader Snyder Rini rioted through Honiara setting alight Chinese shops and homes, as one issue had been changing diplomatic allegiance with China or Taiwan.
Members of the 50-seat parliament had crossed the floor frequently during the three-week negotiations.
In the end, Mr Philip, 57, head of the Reform Democratic Party, beat rival candidate Steve Abana by 26 votes to 23, with one spoiled ballot.
"My government is determined for a common purpose for peace and prosperity," he said, adding that "violence that has marred the country should now be water under the bridge".
The Solomons had been on the brink of anarchy when Australian-led peacekeepers arrived in 2003 to bring to an end a vicious and long-standing ethnic conflict.
Rival militias on the main island of Guadalcanal had fought for control of land rights, jobs and political power.