East Timor's governing party has given its backing to the country's embattled Prime Minister Mari Alkatiri, ignoring widespread calls for him to quit.
Crowds have been calling for Mr Alkatiri to quit
The decision immediately triggered the resignation of popular Foreign and Defence Minister Jose Ramos-Horta.
Mr Alkatiri has been engaged in a power struggle with President Xanana Gusmao, who wants the prime minister to resign following a recent wave of violence.
Thousands of protesters have also been calling for Mr Alkatiri to stand down.
The prime minister had said he would resign if the ruling Freitlin party wanted him to.
But the party decided at a meeting in the capital, Dili, on Sunday that he should remain in office.
Government 'not functioning'
Mr Ramos-Horta immediately resigned from his two Cabinet posts "because the government is not functioning properly," presidential spokesman Agio Pereira said.
Mr Pereira said the minister had been told "that the Freitlin central committee meeting today had decided to keep Mr Alkatiri as prime minister".
Mr Ramos-Horta won the Nobel Peace Prize for his long campaign for East Timorese independence from Indonesia while living in exile in Australia.
Almost 30 people have died in East Timor since March in a wave of violence and political chaos after Mr Alkatiri dismissed hundreds of members of the armed forces.
Last week, Mr Gusmao sent a letter to Mr Alkatiri demanding he step down in the wake of East Timor's worst violence since independence in 1999.
If the prime minister did not resign, Mr Gusmao said he might do so himself. But a rally on Friday called on the president not to step down.
Gusmao had threatened to resign himself
Mr Gusmao is a widely respected former guerrilla leader, seen as perhaps the only unifying figure amongst East Timor's leaders.
But Mr Alkatiri has become increasingly unpopular. Many people have blamed him for failing to prevent recent unrest which has led to thousands fleeing their homes.
He has also been hit by allegations that he helped recruit a "hit squad" to act against his political opponents - accusations he denies but which Mr Gusmao said contributed to his loss of confidence in his prime minister.
There are now a number of armed factions, some originating in the army and police, who are backing one side or the other, says the BBC's Jonathan Head in Dili.
In these conditions the United Nations must somehow try to start a new mission to help rebuild the country's damaged institutions.
The prospects for success look unpromising at the moment, our correspondent says.