Bowing to intense international pressure, President B.J. Habibie said tonight that Indonesia will allow armed foreign peacekeepers into East Timor to quell a wave of killing and devastation by pro-Indonesian militiamen and his own soldiers and police.

The announcement paved the way for an Australian-led U.N. peacekeeping force of up to 7,000 troops to begin operating in East Timor, possibly within days. U.S. officials said the force likely will include a small American contingent, mainly to help with communications, intelligence gathering and logistics, particularly the airlifting of troops from participating nations.

President Clinton, in Auckland, New Zealand, for an Asian economic summit, welcomed Indonesia's decision, but his national security adviser, Samuel R. "Sandy" Berger, cautioned that many key details remain to be settled -- such as the timing of the peacekeepers' deployment, the composition of the new force and its relationship to thousands of Indonesian soldiers already in East Timor.

"The devil's in the details here," Berger told reporters in Auckland. "There are a lot of questions that need to be addressed in the coming days."

In making his announcement, Habibie conceded that, despite a declaration of martial law six days ago, his military has been unable to control the violence that exploded in East Timor after an overwhelming majority of its 800,000 residents voted for independence in a U.N.-sponsored referendum on Aug. 30. That, he suggested, was the reason Indonesia reversed itself after days of refusing to heed demands for an international peacekeeping force from governments around the world.

"The Indonesian defense forces tried to stabilize the situation in East Timor," Habibie said in a nationally televised address from the presidential palace. "At the same time, they have to recognize that there are limits to what more they could achieve. . . . They have done their utmost in a very complex and complicated situation, under very difficult psychological constraints."

Habibie did not elaborate, but his military chief, Gen. Wiranto, had conceded earlier that his soldiers would not shoot the rampaging militiamen because they considered them "brothers in arms."

"Too many people have lost their lives since the beginning of the unrest, lost their homes and security," Habibie declared. "We cannot wait any longer. We have to stop the suffering."

The announcement marked a dramatic, and in some ways humiliating, turnaround for Habibie and Wiranto, who had ruled out foreign troops as long as East Timor remains an Indonesian province. Although the Aug. 30 vote was a clear-cut expression of a desire for independence after 24 years of Indonesian occupation, the decision still must be ratified by the Indonesian People's Consultative Assembly, which meets in October.

The independence vote in East Timor, located 1,600 miles east of Jakarta, triggered the widespread violence and destruction that has left the East Timorese capital, Dili, a smoldering ruin and has created hundreds of thousands of refugees -- some of whom have been trucked across the border into western Timor, while others are believed to be hiding in the forests and hills. There also have been repeated and consistent reports of orchestrated massacres by the militias, particularly of Roman Catholic priests and nuns seen as independence supporters.

Habibie said tonight that he is dispatching his foreign minister, Ali Alatas, to New York to work out details of the peacekeeping operation with U.N. Secretary General Kofi Annan and members of the Security Council.

One key issue will be timing. After Habibie's announcement, Australian Defense Minister John Moore said the force could be deployed "probably on the order of three days to five days." But some analysts expressed worry that Indonesia -- having agreed to accept the troops reluctantly and under pressure -- could drag out negotiations over details.

The size of the force is also at issue. Moore said about 7,000 troops would suffice if the peacekeepers "got total cooperation from the Indonesian army." Without that cooperation, he said, the number would have to be much higher.

Another key issue is the makeup of the force. Australia has offered to lead the contingent and has volunteered to provide 4,500 troops, but Indonesian officials and others have said they would prefer to see a predominantly Asian force. Canada, Britain, New Zealand, Portugal, Malaysia, the Philippines, Thailand and Singapore, in addition to Australia, have said they will contribute troops.

Salim Said, a military analyst who teaches at the Indonesian army staff college in Bandung, about 60 miles southeast of Jakarta, said that the East Timor crisis has fueled strong nationalist and anti-Western sentiment, particularly among those in East Timor opposed to independence, and that Australian troops might be at greater risk from anti-independence militia gangs.

"In East Timor, there is already an `anti-white man' sentiment," Said said. "That's why I think it would be dangerous to send Australian troops."

He said the East Timor crisis -- the independence vote followed by an introduction of foreign troops -- is bound to have domestic political repercussions for Habibie. "It's sad," he said. "It's the second sad day since the announcement of the referendum result. First, we know we had been lied to for 24 years" -- a reference to government assurances that the East Timorese wanted to be part of Indonesia -- "and now we have to admit we cannot take care of East Timor."

Others who had been advocating deployment of foreign troops to stop the bloodletting in East Timor praised Habibie's announcement. "I think it's a crucial decision," said Ana Gomes, head of the Portuguese mission here, who has made strong and emotional calls for an armed force to stop the violence in the former Portuguese colony. "It certainly helps the Timorese, and I think it will help Indonesia."

Gomes and others said the crucial factor in changing the minds of Indonesian officials about foreign troops was international pressure. Clinton, for instance, cut U.S. military ties with Indonesia, and the United States and Britain suspended arms sales worth hundreds of millions of dollars. The International Monetary Fund postponed talks on further loan disbursements, effectively suspending aid, and Pope John Paul II weighed in with his moral authority, demanding that Indonesia admit peacekeepers.

But the greatest leverage may have been threats from Annan and U.N. Human Rights Commissioner Mary Robinson, who said that atrocities in East Timor amounted to "crimes against humanity" and that the perpetrators could face criminal prosecution.

Robinson was in Darwin, Australia, today, talking to U.N. staff members and East Timorese who have been evacuated from the territory. She promised to work for an international tribunal to try those in East Timor responsible for the massacres.