FORTUNE -- The recent demonstrations in Egypt have rocked world markets and sent investors scrambling for the exits. It's not without reason. A possible revolution in the most populous and influential nation in the Arab world shouldn't be taken lightly given the possibility of an anti-Western government coming to power in Cairo.
It's not yet clear what kind of government would emerge if the current autocratic regime led by President Hosni Mubarak were to fall. What is clear is that US economic interests in the entire region would be at risk if Egypt falls under the veil of Islamic fundamentalism. It could lead to the expulsion of US and Western companies from Egypt and threaten the stability of more secular Arab states, ranging from US foes like Syria to staunch US allies like Jordan and Saudi Arabia.
The scenes from the protests in Egypt look eerily similar to ones that swept Iran 32 years ago, which led to the establishment of an anti-western Islamic Republic. The protests in 1978 and 1979, like in Egypt, seemed to catch the world, and the US State Department, totally off guard. They seemed to have sprung out of nowhere but offered some hope that the dictator ruling the country would fall to a more democratic regime.
There are of course very large differences between Arab Egypt today and Persian Iran 32 years ago, but the economic backdrop is similar. The revolution that swept Iran and seems to be festering in Egypt, did not come about overnight. A confluence of economic changes in both countries helped widen the divide between the rich and the poor, bringing about the angst that we see today.
Disparate Egyptian opposition groups, from liberals to Islamic fundamentalists, have banded together to oust Mubarak. Mohamed El Baradei, who won a Nobel Peacce Prize for his leadership of the IAEA, is now leading the opposition groups' newly formed steering committee. El Baradei, who is critical of President Obama's reluctance to call for Mubarak's resignation, is pushing for a peaceful transition to democracy, which has alleviated some fears on Wall Street and Washington.
Western business in an Islamic theocracy
But a revolution can quickly turn. The most powerful group with the largest following usually comes out on top. In Iran, the Islamic fundamentalists had the poor firmly in their grasp and used their mass to overwhelm the other groups. They eventually turned on their former coalition partners and wiped them out.
Such a scenario could occur in Egypt. The largest and most organized of the opposition groups is the Muslim Brotherhood, a banned Islamic resistance movement that is not on the friendliest of terms with the West, especially the United States. It has said it wants to establish Sharia (Islamic) law in the country and ban all women and Christians from government (Christians make up 10% of the population of Egypt). It has no formal connection with Washington but it does have strong ties to Tehran, which funds their activities.
So if Egypt falls to an Islamic theocracy, it will probably spell bad news for the western companies operating in the country. The United States is a major exporter to the country, making up around 10% of Egypt's total imports. The US supplies wheat, corn and soybeans to Egypt averaging around $2 billion a year. That could hurt the sales of companies like ConAgra (CAG, Fortune 500), ADM (ADM, Fortune 500) and Cargill.
The US also delivers $1.3 billion in military aid to Egypt, much of which is recycled back to US defense contractors like Boeing (BA, Fortune 500), Lockheed Martin (LMT, Fortune 500), Northrup Grumman (NOC, Fortune 500), General Dynamics (GD, Fortune 500) and Raytheon (RTN, Fortune 500). They provide support for older US-made military equipment, like the F-4 and F-16 attack fighters, and also sell Egypt new weapons.
Egypt also has a small, but noteworthy energy sector, and has several western energy companies working in the country. European oil companies like the UK's BP (BP) and Italy's ENI (E) have had a major presence in the country for decades drilling for oil and gas.
But no company has more exposure to the energy sector in Egypt like Apache Corporation (APA, Fortune 500). It is by far the largest US investor in Egypt, with a total investment of more than $7 billion over the past 17 years. Egypt now accounts for a quarter of the company's earnings. Apache's large investment in Egypt has not gone unnoticed by the markets. Wall Street has wiped $5 billion off Apache's market value since the riots began amid fears that a new government could expropriate their land concessions. That is equivalent to about 50% of the estimated value of Apache's Egyptian assets.
BG Group, the UK energy company, also has major exposure to Egypt's energy sector, producing over 35% of the country's natural gas. BG exports the gas via pipeline and by ships to consumers in Western Europe. Worried investors sold BG stock on Friday, sending its shares down 5%.
For now, the Muslim Brotherhood is trying to stay low and it has even backed El Baradei in his call for more freedom and democracy. But it is unclear what the Muslim Brotherhood would do if Mubarak flees the country. If the group does take power, it is possible that it won't be as radical as Iran's hardliners were 32 years ago, therefore allowing US and western companies to remain in the country.
After all, Egypt is in dire need of foreign capital, food, weapons and energy -- all the things western companies bring to Egypt. But in a revolution, rational thought usually gives way to irrational actions.