In the port town of Balikpapan, on Borneo island, an Australian diplomat was dispatched to help rescue Australian mine workers besieged by people demonstrating against foreigners. He spent most of his time hiding from angry crowds, running down back stairwells and being trundled into a getaway van.

In Banyuwangi, in East Java, more than 100,000 Muslims signed up for a jihad, or holy war, against foreign peacekeeping troops if they try to invade Indonesia, and their leader predicted Australian soldiers will go home in body bags from the peacekeeping venture in East Timor. "It will be like Somalia," said Abdurrahman Wahid, in an interview. "It's more than Somalia. I know my people. They are angry."

And in the western Timor town of Atambua, a flamboyant militia leader, Eurico Guterres, pledged to attack the Australian-led peacekeeping force "because they are white people." He warned: "We East Timorese are thirsty for the blood of white people."

As the U.N.-sponsored intervention force prepares to land on the shore of Dili, East Timor's seaside capital, to end a rampage of killing and destruction by armed militia gangs and their military backers, Indonesians are coming to grips with what many in the political elite are calling a national humiliation, and some are envisioning as a possible call to arms.

Few here talk about the atrocities committed by Indonesians in East Timor after residents voted overwhelmingly for independence on Aug. 30 -- the killings of priests and nuns, the razing of the capital, the mass deportations. Instead, many are focusing on what they see as the Western world's unfair pummeling of Indonesia, including the suspension of military ties, the threats to cut off aid, and now the indignity of foreign troops landing in East Timor, which Indonesians call "the 27th province."

Those feelings of anger and humiliation are producing a sometimes nasty, xenophobic outburst of nationalistic pride in the world's fourth-largest country, with the largest Muslim population in the world, and many leaders are warning that the overwrought emotions could spiral out of control.

The backlash began as anti-Australian, but is becoming anti-Western, and more broadly anti-white, tapping into deep-seated feelings of resentment reaching back to the period when Indonesia was a colony. And with the peacekeeping troops due to arrive in East Timor Sunday or Monday, those feelings could lead to violence.

"People are no longer really focusing on what happened in East Timor, but on how Indonesia has been insulted," said Dewi Fortuna Anwar, a political scientist who serves as foreign policy adviser to President B.J. Habibie. "There's always been a suspicion of white people in general, which is understandable because of the long experience in colonialism. . . . The feeling is always there. Indonesia has always been very touchy about being pushed around by outside countries."

So far, Anwar said, most of the anger has been directed against Australia and its prime minister, John Howard, whom she accused of "trying to prove his manhood and saying some very ugly things" about Indonesia, and thus "waking up this dangerous nationalism." But she said the United States, through President Clinton and Secretary of State Madeleine K. Albright, had been "more moderate" and shown more sensitivity, and U.S. relations with Indonesia should not suffer.

"The U.S. has a very important role to play in supporting the democratic process here," Anwar said. "Indonesia cannot be left alone wallowing around in narrow nationalism. If it goes down, the region goes down."

Wahid, who heads Indonesia's largest Muslim organization, Nadhlatul Ulama (NU), also put much of the blame on Howard and Australians, who he said are helping whip up the nationalist frenzy.

"There are calls in Australia to invade Indonesia," said Wahid, who also heads the National Awakening Party, which finished in the top four in recent parliamentary elections, making Wahid a long-shot candidate for president. "They are crazy. Put it in writing -- they are crazy. "

Wahid said Howard "has a personal interest in seeing his popularity rise. But let's wait several months from now, when the East Timorese integration [anti-independence] people begin to kill them. We know it will happen." He added, "When 10 of them are hit, that will change public opinion in Australia."

To be sure, there are strong emotions on both sides, with anti-Indonesian passions whipped up among Australians as reports accumulate of the massacres inside East Timor, which is less than 500 miles from Australia's northern coast. Australian dockworkers have refused to unload Indonesian goods from ships, and unions have boycotted the Indonesian Embassy and consulates, meaning trash is not collected and water is cut off. Some Indonesian facilities in Australia were vandalized.

The small but organized crowds that attacked Australian consulates and trade offices and the embassy here in Jakarta said they were retaliating for the vandalism against their missions in Australia.

Much of the outrage seems orchestrated, or at least tolerated by authorities. In Balikpapan, a port town where many Australian mining and mineral companies have offices, the demonstrations were held by a well-known government youth organization that has long been accused of being a violent intimidation force.

During the almost daily demonstrations in Jakarta, riot police stood by when students attacked the fence of the Australian Embassy, but when anti-government students held a march to protest military brutality in East Timor, the police charged in with tear gas and rubber bullets.

Much of the nationalist sentiment is real, not contrived, fueled not only by the intense pressure on Indonesia to accept the peacekeeping force, but also by the actions of unions and East Timorese activists in Australia. And it has extended to include Western journalists and aid workers.

What is unclear is how this rising anti-Western sentiment affects Habibie, whose term ends in two months and who is planning to seek a new mandate when the People's Consultative Assembly convenes in October to choose a president.

The current crisis was sparked by Habibie's idea of a "snap" referendum on Timor, offering East Timorese a choice between autonomy within Indonesia, or full independence. The independence forces won, with nearly 80 percent of the vote. Now Habibie is being called before parliament on Tuesday to answer questions on the debacle, which has raised fears that the nation could begin to disintegrate.

Habibie's political opponents have seized on the East Timor crisis as a chance to block his path to reelection. For this reason, most of the blame for allowing East Timor to break away has fallen not on the Indonesian military, but on Habibie. Habibie's main rival for the presidency, opposition leader Megawati Sukarnoputri, has said Habibie alone is responsible because he announced his referendum plan "suddenly and irresponsibly."

In a country as vast as Indonesia, everyone does not feel the same. One young man, an editor for a fashion magazine, expressed a view that may be the sentiment many nationalists fear most.

"I support the East Timorese people's right to independence," he said. "I am from North Sumatra. Maybe one day we can be independent, too."

Then he paused and added, "But I don't dare say that too loudly."