CAIRO, Egypt (AP) _ Events of the last 100 days have cost impoverished Sudan the support of Egypt, the United States and wealthy gulf Arab countries. Basically all that's left are handouts from Moammar Gadhafi's Libya.

The isolation comes as it becomes increasingly likely Sudan will face a famine that Western relief officials say could threaten up to 11 million people.

Sudan's troubles began when Lt. Gen. Omar Hassan el-Bashir's military government found itself on the other side of the Persian Gulf crisis from its most important friends.

Paying back old political and military debts, el-Bashir's junta refused to condemn Iraq's invasion of Kuwait on Aug. 2. That alienated most of Khartoum's friends, who are demanding that Iraq quit Kuwait.

Traditionally, the Sudanese could rely on its big brother to the north, Egypt, to bail it out of trouble. For two decades, food and other aid from the United States and the West have kept the country going through flood, famine and political turmoil.

And Saudi Arabia and Kuwait, the first now a bitter enemy and the second an occupied country, had provided hundreds of millions of dollars to help develop an agricultural potential once considered the greatest in Africa.

One of the junta's few allies since the invasion has been Gadhafi, the Libyan strongman.

He's promised to shore up Sudan's tottering Central Bank with $100 million. He's sent 40,000 sacks of cement to restore schools damaged by floods in 1988. He's pledged to build a system of paved highways in Khartoum, a sprawling, dusty city of mainly dirt roads.

Additionally, Col. Youssef Abdul Fatah, Khartoum's deputy commissioner, said Libya donated ''10 huge electricity generators to be used in emergencies and to help in pumping water to some of the capital's districts.''

Welcome as it is, such largesse does little to make up for the loss of Western and Arab support.

The invasion cost Sudan at least $2 billion in lost remittances from 20,000 workers who were brought home from Iraq and Kuwait by the Sudanese government.

The minister of expatriate affairs, al-Saeed Osman Mahjoub, said the repatriated people suffered at least $500 million in ''personal losses'' like abandoned belongings in Kuwait and Iraq.

And the junta's economics overseer, Col. Salah al-Deen Karar, told the official Sudan News Agency the country is being ignored. ''We've notified international organizations of our losses and demanded to be treated on an equal footing with countries economically affected by the gulf crisis'' like Jordan and Egypt, he said.

But the world is proving unsympathetic to demands that Khartoum be compensated for dislocations to the economy. The message is that Sudan made an uncomfortable bed by siding with Iraq, but it will have to lie in it.

In October, Sudan invited Gadhafi as guest of honor at a ceremony announcing the country's future system of government. Not surprisingly, it resembles closely the Libyan ''jamahiriya'' based on Gadhafi's theory that people should rule themselves through mass meetings, not through elected representatives.

The junta's debt to Gadhafi was so great that he was allowed to suggest on national television, unchallenged, that ''religion should be distanced from politics. ... If brought together they spoil each other.''

Sudan's basic law is the Islamic Sharia, a 1,400-year-old legal and ethical code. And junta leader el-Bashir is a devout Moslem with leanings toward the fundamentalist National Islamic Front, although it like other political parties has been banned since his coup on June 30, 1989.

In the same speech, Gadhafi told the Sudanese a northeast African merger of their country, Egypt and Libya could become a great world power. He attacked the West for laughing at his ideas. During his October visit, Gadhafi also threatened to intervene in Sudan's drawn-out and expensive southern civil war unless the rebels stop fighting.

The junta clings to the hope of a solution by force and last month once again used the food weapon, bombing foodstocks to starve the rebels. The decision drew criticism from the United States and other governments who earlier ignored similar activities by both sides.

Possibly the decision hardest to explain is the junta's adamant refusal to acknowledge that famine stalks the countryside again, even after a governor in western Sudan declared his region a disaster area.

The denial instigated another fight with Washington and made Western relief officials seethe. Without a government appeal, famine relief cannot be organized.