Updated

Security forces fired tear gas at mobs torching government buildings and foreign aid offices Tuesday as street violence triggered by the appointment of East Timor's new prime minister spread beyond the capital, police and witnesses said. Six people were wounded.

Hundreds of youths also threw rocks at U.N. vehicles and police, looted a market, and set up roadblocks of burning tires, despite the presence of 3,000 peacekeepers dispatched to maintain order in Asia's newest nation.

President Jose Ramos-Horta handed the top government job to Xanana Gusmao on Monday to break a political logjam after no single party won a majority in June's parliamentary elections.

The former ruling party, Fretilin, called the decision illegal and vowed to have it overturned in court, but an appeal for supporters to remain calm appeared to go unheeded.

Gangs rampaged in the capital, Dili, but the worst violence was in Baucau, 80 miles to the east, where buildings housing the offices of international aid organizations and government agencies were set on fire, said police inspector Pedro Belo. A market also was looted.

In Viqueque, another Fretilin stronghold to the south, two houses and a minibus were set on fire, a security statement said.

East Timor broke free from decades of Indonesian rule in 1999 in a U.N.-sponsored referendum. Three years later it formally declared nationhood, but the euphoria quickly evaporated amid the challenges of governing a divided, impoverished people.

Last year, a military mutiny sparked clashes between rival troops that led to gang violence, arson and looting. More than 35 people were killed and some 150,000 others fled their homes before the collapse of the government and the deployment of foreign peacekeepers.

The United Nations, which has been overseeing security since last year's spasm, described the country as "volatile" and "tense," but stressed that the situation was under control.

At least 15 U.N. vehicles were damaged by rock throwing, it said in a statement, adding that perpetrators of Tuesday's unrest would be "treated as criminals and swiftly dealt with."

Authorities had been expecting violence after Monday's announcement.

Fretilin won 21 seats in the 65-member Parliament, well short of a majority, but insisted it had the right to form the next government. Gusmao's party won 18, but formed a coalition that now comprises 37 seats.

"We will do everything we can to raise awareness among the people so they can combat through legal means this usurping of power," said Fretilin party head and former Prime Minister Mari Alkatiri. "Fretilin will initiate multiple actions within the law to ensure respect for the Constitution."

Gusmao, who was the country's first president, is to be sworn in on Wednesday. He is revered by many in East Timor for leading the armed resistance to Indonesian rule, but like Alkatiri his reputation has been tarnished by last year's violence. Both men have been accused of fueling divisions to further their political ambitions.

East Timor, a former Portuguese colony, faces major security, humanitarian and economic challenges. It has significant offshore oil and gas reserves, but unemployment in the nation of less than 1 million people hovers at around 50 percent.

Six people were injured Tuesday, including a young boy, said Liborio da Costa Alves, a hospital doctor.