CAIRO, Egypt (AP) _ An experiment by well-heeled Moslem fundamentalists to make money by capitalizing on religious Egyptians' devotion to Islam has gone sour.

For years, more than 100 Islamic investment companies seemed to work perfectly, and by late 1987 hundreds of thousands of mainly small-time investors were participating in the companies' profit-sharing schemes.

The companies drew up to $3.5 billion from depositors, many earning three times what they would have from banks - and without interest, banned as usury by Islam's holy book the Koran.

But all was not well behind the scenes. Rumors circulated of illegal dealing by many of the big companies, including black marketeering, capital flight, money laundering and skimming off new depositors' funds to pay obligations to old investors.

Finally, last August, the government stepped in, enacting a law that in November effectively brought the companies under the control of the Central Bank and the Economy Ministry.

The result: deep legal trouble for most of the companies and a long and tormenting wait for investors, many of whom face the possibility that much of their savings are lost.

The wait ended for some in November, when 13 of the 104 investment companies provided required documentation and said they want to stay in business under the new guidelines. Another 23 declared they would liquidate and return investors' funds.

But officials revealed that 68 companies and individuals connected with them were liable for prosecution.

The biggest company, al-Rayyan, worth more than $1 billion, came under heavy fire. Attorney General Gamal Shouman ordered detention of 49 of its officers, their family members and the company's accountants and froze their assets on grounds their illegal operations jeopardized depositors' funds.

Under supervision of the Ministry of Justice, security officers sealed the company's many warehouses, jewelry stores, restaurants and other establishments.

There is no official estimate of Islamic company holdings, but newspapers have reported totals of 6 billion to 8 billion Egyptian pounds ($2.6 billion to $3.5 billion). Additionally, unknown amounts are said to be stashed in banks abroad.

The wait has been unpleasant for depositors and the state.

''I've been coming here to get my return for three months now,'' Saddiqa Ahmed, who had deposited about $870 with al-Rayyan Co., said as she stood one October day with other disgruntled depositers outside company headquarters.

''Every time they tell me to come back next week. Now they say they have no money to give us. What am I to do?''

She was among about 175,000 people who deposited money, sometimes life's savings, with al-Rayyan, which operated about four years before its closure.

Ten female depositors marched on President Hosni Mubarak's house to vent their fury, bringing in hundreds of security troops in gas masks, shields and helmets to protect Mubarak from other possible outbursts.

The Islamic investment movement was begun more than 10 years ago by el- Sherif Co., a plastic manufacturer that is among the handful of companies in full compliance with the new law. It drew deposits from Egyptian workers in oil-rich Arab states by promising high returns through a system prescribed by the 1,400-year-old Islamic legal and social system, Sharia.

Sharia bans interest payments on loans or deposits but allows profit- sharing, with its attendant risks.

As Islamic fervor increased across the country, many more companies sprang up. Company owners, pictured in newspaper advertisements wearing white robes and skull-caps and long, bushy beards typical of Moslem fundamentalists, appealed to investors' piety as well as investment sense.

Targeting Egyptian expatriates during the early 1980s Arab oil boom, the companies soon were collecting more remittances in hard currency than banks, which had to convert the money at official exchange rates much below those available on the black market.

Since the mid-1980s, the companies regularly have returned up to three times the 10 percent average interest rate offered by banks.

Company names, many with Islamic connotation, sprouted along highways on billboards and in cities on jewelry stores, sophisticated butcher shops and alcohol-free restaurants. One investment company even ran a summer camp and hotel on Egypt's western Mediterranean coast.

The government began to suspect dubious activity last year, soon after reports began appearing of enormous losses by a couple of the larger companies from speculating in gold and silver on European markets.

Many Egyptians felt the government acted to curtail a potentially dangerous increase in the companies' power and because of indications that some may have been funding religious extremist groups that demand immediate and total implementation of Sharia. The government claims 90 percent of Egypt's legal code already conforms to Islamic law.

The government said it acted simply to protect depositors and has vowed to try its best to refund them.

Hardly any fundamentalist propaganda was evident in this fall's important university election campaigns. Campus and police sources attributed the decrease to the crackdown, either because of a drop in direct funding of favored candidates by Islamic companies or a decline in parents' profit- sharing income.

By last summer, many companies were postponing payments, which worried customers and prompted firmer government measures such as banning company owners from travel.

A week before the November deadline for compliance with the new law, Prime Minister Atef Sidki used a rarely invoked power to issue a military order freezing al-Rayyan's monetary transactions retroactive to April 1988. But the action created even more confusion for investors.

''What is the government doing to us?'' protested one depositor after the al-Rayyan freeze was announced. ''We knew these company owners were thieves, but we were receiving our monthly dividends.

''The state is killing us swiftly with its own hands, instead of leaving us to die slowly,'' he said. ''We'll never see our money.''

To further complicate the situation, stories of scandal surfaced involving al-Rayyan and the three brothers who ran it.

One, Mohammed Tawfiq Abdel-Fattah al-Rayyan, was arrested and jailed for importing foodstuffs illegally.

At about the same time, Mohammed's older brother Fat'hy was hospitalized for a nervous condition, then became addicted to his medication. He died in early November, officially of a heart attack but according to newspaper reports more likely of a drug overdose.

As the youngest brother, Ahmed, became chairman of the board, the government assigned security officers to keep tabs on al-Rayyan family members.

End Adv Monday Dec. 5