By Jonathan Head
South East Asia correspondent, BBC News
It was with a characteristically unemotional performance that Mari Alkatiri announced the end of his - and East Timor's - first prime ministerial term.
Mari Alkatiri has been blamed for all that has gone wrong
"Having reflected deeply on the present situation prevailing in the country, assuming my own share of responsibility for the crisis, I am ready to resign from my position as prime minister," he told a press conference in Dili.
This, after weeks of pressure, during which he had repeatedly insisted his resignation would solve nothing, and had received the full backing of his party, Fretilin, which holds a majority of the seats in parliament.
So why the change of heart?
Mr Alkatiri referred to his desire to avoid a threatened resignation by President Xanana Gusmao - but that threat was made last week, and then withdrawn, so it is difficult to understand why it would have changed his mind now.
More likely it was the continued discussions with his colleagues in government on how to get East Timor out of the mess it is in that persuaded Mr Alkatiri to go.
He has long been indifferent to his own unpopularity, but in the current chaos the country needs a less divisive leader.
There was jubilation over the decision across the capital, Dili, and probably in many other areas of East Timor.
Mr Alkatiri has become a hate-figure, blamed for everything that has gone wrong in the country, and it was hard to see how rebuilding confidence and stability after the traumatic events of the past few weeks could start while he remained in office.
But was he really so bad?
You hear many complaints about Mr Alkatiri, some of them obviously unjust.
I have often heard young people complain that he is a Muslim, as though that is a crime in a supposedly democratic and tolerant country.
President Gusmao has a popularist touch
They also accuse him of being a communist, because of his left-wing views and his long years living in Mozambique.
But these may at times have served East Timor well. His instinctive mistrust of Western help led him to drive a very hard bargain with Australia over East Timor's rights to oil and gas in the Timor Sea, helped by his skills as a negotiator.
It is unlikely anyone else could have done as well for the country.
He also has a deep personal commitment to the sustainable development of his country, and has tried hard to avoid too much aid dependency - ideas formed during his African exile.
Much of his unpopularity is due to his brusque, business-like manner.
He is an intellectual, impatient with people who express poorly thought-out ideas.
He has never seemed able to empathise with the suffering experienced by much of the population during the Indonesian occupation, or to find the right words to comfort those who are often unable to articulate what they feel about those years.
By contrast, President Gusmao is a master of the art of healing. With a few simple words, or just a hug, he can move crowds to tears.
Shortage of talent
The two men who have been running the country since independence could hardly have more different styles, and they have had a very uneasy relationship with each other.
Much of that goes back to Mr Gusmao's distrust of the Fretilin party, which he blames for harsh treatment of its rivals during the bitter struggle against Indonesian rule.
Mr Alkatiri is a consummate party man - Fretilin reaffirmed its backing for him three times in recent weeks, the last time less than 24 hours before he resigned.
The party remained loyal to the end, but he was arguably the wrong kind of leader for a country as traumatised as East Timor.
Crowds have been calling for Mr Alkatiri to go for weeks
More serious are the charges against Mr Alkatiri of corruption, and abuses of power.
Some of these will now be examined by an internationally-supervised investigation, as East Timor's infant judiciary is not up to the job.
Some corruption is perhaps inevitable, given the traditions of patronage and money-politics that prevail elsewhere in the region, but the charges of abusing his power are more serious.
A documentary by the Australian Broadcasting Corporation's Four Corners programme claims to have documentary evidence that Mr Alkatiri tacitly approved of the distribution of police weapons to civilians - a charge that has already led to the arrest of former Interior Minister Rogerio Lobato, at one time an ally of the prime minister.
Mr Alkatiri has denied the charges, and the prosecutor-general says he has not yet uncovered any evidence against him.
Certainly the murky events leading up to and after the fateful decision by Mr Alkatiri to endorse sacking more than a third of the army earlier this year need more investigation.
The fact that he was re-elected at the Fretilin party congress last month by a show of hands, rather by a secret ballot, does not reflect well on his democratic values.
But it is also worth remembering that East Timor has few capable leaders.
Education levels are among the world's lowest, and the long years of conflict under Indonesia's occupation, and Indonesia's chaotic withdrawal in 1999, left few local people with experience of government.
Mari Alkatiri is among the best they have. The country can ill-afford the loss of his abilities.