The new prime minister of the Solomon Islands has resigned after his election provoked two days of rioting and looting in the capital.
Snyder Rini resigned on Wednesday just before a planned vote of no confidence that the opposition expected to win.
He told members of parliament he was quitting "so all MPs can come together so this country can go forward".
Rini had been confident in recent days he could secure enough support in the 50-member parliament to defeat the motion.
But at least five MPs joined the opposition ranks on Wednesday morning, giving them a majority of 29.
After Rini announced his decision to resign in parliament, he crossed the floor of parliament amid applause to hug opposition leader Job Dudley Tausinga as other MPs jumped up from their seats to hug and shake each others' hands.
Rini left the building surrounded by 12 heavily armed police and was driven away without any making any comment to the waiting media.
He will remain caretaker prime minister until MPs hold a fresh election.
Tausinga is expected to be one of the favourites to take the prime minister's job.
Australia, New Zealand and Fiji all sent troops to the Solomons last week to end rioting that reduced Honiara's Chinatown to smouldering rubble.
The opposition had claimed that Rini had corrupt links with local Chinese businesses and with Taiwan.
The Solomon Islands is one of 26 countries that gives diplomatic recognition to Taipei rather than Beijing.
Last week's violence was the worst since 2003, when an Australian-led intervention force arrived to end five years of civil unrest in the impoverished South Pacific archipelago.