Sri Lanka's disputed Prime Minister Mahinda Rajapaksa has stepped down from his post, signalling an end to a weeks-long political crisis that has kept the Indian Ocean nation without a functional government.
Rajapaksa signed a letter of resignation in front of supporters and journalists at his private residence in the country's capital, Colombo, on Saturday.
In a subsequent statement, the 73-year-old said he was bowing out to allow President Maithripala Sirisena to "form a new government".
Sri Lanka has been in crisis since October when the president fired Prime Minister Ranil Wickremesinghe amid a bitter power struggle, and replaced him with Rajapaksa, a popular former president who is accused of corruption and wartime atrocities.
The feud put the country on the path towards a government shutdown with parliament unable to pass spending for 2019 as legislators clashed on the chamber floor - throwing chairs, books, and chilli paste - over who should remain the country's prime minister.
Wickremesinghe insisted his sacking was illegal, and his United National Party (UNP), which has a majority in the 225-member House, passed two no-confidence motions against Rajapaksa.
But Sirisena ruled out ever reappointing Wickremesinghe and tried to dissolve parliament in a bid to hold new elections.
That attempt was thwarted by the Supreme Court, which on Thursday said the president's moves to sack the House was unconstitutional.
Following Rajapaksa's resignation, Sajith Premadasa, UNP's deputy leader, told reporters the party was ready to work with Sirisena in government again.
"Sirisena was misled by some groups who were against our administration. It is because of them that he removed Wickremesinghe" he said at Temple Trees, the prime minister's official residence where the deposed leader has remained holed up since the crisis began.
Premadasa said the president would reappoint Wickremesinghe as prime minister soon.
There was no immediate comment from Sirisena.