East Timor's capital was in chaos yesterday as rival gangs attacked each other with machetes and spears and set houses aflame, defying international peacekeepers patrolling in armed vehicles and combat helicopters.

Prime Minister Mari Alkatiri told a news conference the fighting was part of an attempted coup d'etat as fires raged across the city and residents fled or hid, terrified, in their homes. Minutes before he spoke, Australian troops had disarmed up to 40 machete-wielding gang members half a block away.

More than 1,000 Australian troops, sent in response to an emergency call from the fledgling country's government two days ago, patrolled the city in armoured personnel carriers and tanks, and Black Hawk helicopters thundered overhead. But mobs rampaged regardless, and sporadic gunfire was heard. There were seven injuries, mostly in street clashes. Foreign soldiers were not believed to have fired their guns.

In one raid, dozens of houses and cars were set ablaze. Women and children fled screaming to seek shelter at a nearby church. Thousands of other residents loaded provisions into vehicles and drove to embassies, the airport or makeshift shelters.

'We are afraid. At night they fire guns, or maybe worse, so I had to run to the UN,' said Anim, as she prepared to spend a night with her four children in a crowded camp at the UN base.

The violence was triggered by the March sackings of 600 soldiers - nearly half the army - and is the most serious crisis in East Timor since it broke from Indonesia in 1999.