The East Timorese president has taken over direct control of the armed forces and declared a state of crisis in an attempt to end violence by rampaging rival gangs that have killed at least 27 people in the capital Dili.

East Timor's president, Xanana Gusmao, announced late Tuesday he would assume sole responsibility for the defense and security of his nation.

"From now on, all the responsibilities on defense and security is under my responsibility as supreme commander of the forces," he said.

Earlier, officials announced the defense and interior ministers had been fired during emergency crisis meetings.

The unrest began in March when the government dismissed nearly 600 soldiers of the 1,400 member army after they deserted, alleging discrimination and poor working conditions.

Last week the fighting between the dismissed soldiers and government forces erupted into general civil unrest.

Mr. Gusmao said he had made the decision to assume emergency powers "in close collaboration" with Prime Minister Mari Alkatiri.

But Mr. Alkatiri is under pressure to resign, with many East Timorese blaming him for failing to handle the crisis. It is also widely believed here that he and the president disagreed over how to end the growing violence.

Mr. Gusmao said he intended to stop the violence and address the growing humanitarian crisis, but did not want to restrict civil liberties or democracy in the impoverished nation.

"We chose to call this situation a state of grave crisis, grave in terms of big crisis, not a state of siege because a state of siege will restrict some legalities, some freedom, and we want to avoid this," he added.

Mr. Gusmao also said the "State of Grave Crisis" would be in effect for 30 days and could be extended.

He called for the gangs to turn their weapons over to international peacekeepers who arrived last week after the government appealed for international help to quell the unrest.

The fighting has exposed old rivalries between those from the east of the country, who are seen as having fought for East Timor's independence and those from the west, who are seen as having supported Indonesia's brutal 24-year rule.

At least 70,000 people have fled their homes seeking protection in makeshift refugee camps that have sprung up all over the city, where food, water, medicine and adequate shelter is lacking.

Shops and businesses remain closed Tuesday as looters ransacked shops and gangs continued to attack neighborhoods, torch buildings, and loot freely in Dili's streets, despite the presence of international peacekeeping forces.