In the end, the loot came out in bulging crates, suitcases and diaper boxes. But for years before, billions of dollars had fled the Philippines on high-tech paths of wire transfers, shooting like electrical charges from Manila to Manhattan to Geneva, taking cover in supersecret offshore corporations along the way.

The Philippine president issued decrees that enriched favored businessmen, who recycled the gains into hidden stakes for him in overseas banks, skyscrapers and corporations. Foreign firms paid his friends millions of dollars to be "facilitators." Millions more were siphoned from foreign bank loans, American bankers think. Much of this wealth fled the country, too.

On President Ferdinand Marcos' orders, $1.5 million would be withdrawn from government intelligence funds to finance his First Lady's travels to Kenya, Iraq, New York and the Caribbean; on Imelda Marcos' orders, hundreds of thousands of dollars would be delivered to her Manhattan hotel room in a large attache case from the vault of the Philippine National Bank.

There were bank accounts in code names, shell companies from Hong Kong to Aruba and a palace closet harboring hundreds of dresses, five shelves of Gucci handbags, 500 black brassieres and 3,000 pairs of shoes.

This is the anatomy of a looting, documented in a flood of records, depositions and confessions obtained since the fall of Philippine president Marcos. Much more is likely to emerge, as investigators in the United States, Europe and the Philippines pull away the veils surrounding Marcos' financial empire.

Philippine officials estimate that as much as $30 billion left the country in the Marcos era, about the amount of the gross national product -- this, in a country where unauthorized export of foreign exchange is illegal.

"What we have here is an international mass burglary achieved through classic political skimming," said Rep. Jim Leach (R-Iowa), ranking minority member of the House Foreign Affairs subcommittee investigating Marcos' hidden wealth.

Several U.S. officials cautioned that the scenario may also fit other U.S.-backed countries with rich resources and centralized power. They noted that the United States generously supported the Philippines throughout the Marcos era, although officials here were well aware of corruption and repression.

"My first reaction is to caution anybody about getting too shocked over Marcos," said a former State Department official who served in the Philippines. "But the magnitude is just breathtaking. I'm shocked along with everyone else."

The story of the Marcos wealth began to unravel when the president and his wife fled their opulent Malacanang Palace on Feb. 25, leaving behind a mountain of records in once-secure hideaways.

Another 2,300 pages of documents, brought on a C141 transport plane with the Marcos entourage to Hawaii, was seized by the U.S. government and released in Washington. Also on board were $7 million in cash and jewels, including tiaras, earrings, broaches, rings, cufflinks and chokers made of gold, silver, diamonds, emeralds, rubies, sapphires and pearls.

The complete holdings of the family may never be known. The Marcoses appeared to have kept, at best, haphazard records of their global empire, alleged to be as diverse as copper mines in the Philippines, trust accounts in Switzerland and land in Corpus Christi, Tex.

So much wealth is held in the names of others that as Marcos' health deteriorated, his daughter, Imee, recently wrote his associates seeking an account of what was theirs and what was her father's, Philippine investigators said.

Moreover, after poring over 2,300 pages of documents brought to Hawaii by the Marcos entourage and released in Washington, several investigators here questioned last week whether some of the records are bogus -- decoy vouchers for money that was diverted elsewhere.

The new Manila government estimated Marcos' "hidden wealth" at $5 billion to $10 billion, contrasting it with the Philippines' per capita income of $600. A U.S. authority on the Philippine economy called the $5 billion estimate "entirely possible."

How could so much wealth emerge from such a poor country? The documents hold several clues.

After declaring martial law in 1972, Marcos created monopolies to market his country's most valuable commodities, such as sugar and coconuts, and installed his closest allies to run them. He also issued numerous decrees protecting from competition firms owned by his relatives and friends.

The monopolies, exempt from normal government audits, generated vast amounts of capital through levies on growers, which were deposited in banks that they and other Marcos associates controlled. Roberto S. Benedicto, who ran the sugar industry, controlled the Royal Traders Bank and Republic Planters Bank; Eduardo M. Cojuangco Jr., the "coconut king," controlled the United Coconut Planters Bank.

Alfredo Romualdez, brother of Imelda Marcos, controlled the $200 million-a-year casino monopoly, which banked at Royal Traders. So many relatives of Marcos and his wife held so many positions in public and private life that some Filipinos here dubbed the system "Marcos-Romualdez Inc." (In Manila, it is known as "crony capitalism.")

The documents and depositions unveiled in recent weeks suggest that at least some of this wealth came back to Marcos.

A bank account described in one Marcos document shows a $3 million deposit from someone identified as RSB, the initials of Benedicto. Another of the documents seized in Hawaii showed $2 million of shares in the California Overseas Bank, purchased by Benedicto in 1976, belonged to "FM" or Marcos.

Also among the Hawaii papers was an accounting of millions of dollars of "commissions" paid by foreign companies to Marcos' close friends as costs of doing business in the Philippines. Investigators have alleged that Marcos kept such records because some of the payments were his.

Herminio Disini, an in-law of Imelda Marcos whose wealth grew in part from a Marcos decree favoring his cigarette filter business, was listed as receiving $11 million in payments over several years from Westinghouse Electric Corp., after helping the firm win a contract to build the Philippines' first nuclear power plant.

A federal grand jury in Pittsburgh is investigating whether some payments -- shown as going into Swiss and Philippine accounts -- reached Marcos as kickbacks, according to government officials. Westinghouse has acknowledged payments to Disini, but said that none were known to have reached Marcos and none were improper.

Five Japanese companies were shown in documents to have paid $1 million to Philippine middlemen. A "side agreement" from Antonia T. Lagarejos, contained in the documents seized in Hawaii, promised payment of $5 million to a Paris bank account in return for the purchase of 500,000 metric tons of Philippine raw sugar.

A memo in a palace file showed a company called Noah's Ark Merchandising agreeing to pay $600,000 in return for the right to sell 300,000 cartons of sardines and mackerel in the Philippines.

All of this took place against the backdrop of an economy collapsing from debt, inefficiency and unemployment. In the 1970s, when major banks were flush with petrodollars, the Philippines' foreign debt grew 25 percent a year. It now stands at an unsupportable $26 billion, about five-sixths of the GNP.

Enterprises run by favored Filipinos secured numerous loans in this period, with government guarantees in case the projects failed. U.S. bankers and Philippine investigators said last week that documents and new evidence suggest some of the loan money was systematically diver- ted.

Amid the dark revelations was some incongruous comedy. The new government released videotapes, found in the palace and the Marcos' six-story Manhattan town house, showing lavish Marcos family parties. Anti-Marcos activists showed one tape in Washington, gleefully narrating and pointing out such excesses as diamonds on Imelda Marcos' shoes.

The videotape, which recorded a September 1985 dinner party given by Imelda Marcos in New York, was blurry in parts because of glinting diamond jewelry, silver service and crystal in the dining room. After dinner, the group retired to a discotheque on the sixth floor, dancing to the sounds of Lover Boy, under strobe and neon lights.

"People like to be surrounded by the beauty of life. I believe that life is love and life is beauty," Imelda Marcos said, addressing the guests.

As documents emerged linking Marcos to a $500 million real estate empire in New York, Texas, California and Washington state, American officials appeared hard-pressed to respond. President Reagan cautioned that "the information I've always had was that he was a millionaire before he took office" and that some of the wealth was probably legitimate.

But Jovita Salonga, head of an Aquino government commission investigating Marcos' "ill-gotten" gains, unveiled Marcos' tax return for 1960, six years before he took office, showing only $17,000 of income.

Other preconceptions about the Marcos era also crumbled under the weight of the documents. While Philippine observers had said corruption began in earnest when Marcos declared martial law in 1972, the documents dated it earlier.

In 1968, two years after he took office on a vow to fight corruption and capital flight, Marcos and his wife had set up Swiss and U.S. bank accounts to hide assets, according to documents obtained by Salonga and others.

"They were depositing money in Swiss banks using code names such as Jane Ryan and William Saunders," Salonga said in an interview. "They authorized the practice under the signature of both Imelda Marcos and Ferdinand Marcos."

The layers of secrecy surrounding the wealth were almost dizzying. Take the 71-story office tower at Manhattan's 40 Wall Street, listed in New York records as belonging to Nyland (CF8) Ltd., but tied in documents to the Marcos family.

Nowhere on the documents does the name Marcos appear, but the paper trail led to the palace:

Nyland, which bought 40 Wall St. in 1982, was owned by three Panamanian companies, which in turn belonged to a trust account from the Chartered Bank of Hong Kong. Records of the three companies were routinely mailed to the Unam Corp., a Netherlands Antilles firm controlled by Jose Y. Campos.

Campos, who made a fortune in the Philippine pharmaceutical industry with the help of decrees by Marcos, recently confided in a statement to the new Manila government that he organized 40 shell companies to hide Marcos' wealth.

Another Marcos financial adviser, Rolando Gapud, president of the Security Bank and Trust of the Philippines, has given a more limited statement to the Salonga commission, acknowledging additional secret bidding for Marcos.

Money to finance the overseas purchases was shifted from Manila to bank accounts in Hong Kong, Switzerland and New York, investigators said. It then was wired to accounts in the names of various shell companies and into investments in the names of those shells.

Almost every feature of the transactions was tinged with intrigue. Gliceria Tantoco, a friend of Imelda Marcos alleged by Philippine investigators to have been a "front" for the first family, sent coded cables from Manhattan to Manila to report on the Marcoses' holdings.

"Midtown Cement" was the code for 200 Madison Ave. "Farragamo" meant the $51 million Crown Building on Fifth Avenue. "Bridgetown" meant 40 Wall St. "Lafayette" meant the $70 million Herald Center shopping mall. "Esquire" meant Joseph Bernstein, a lawyer recently revealed to have represented the Marcoses in real estate transactions.

Like Gapud and Campos, Bernstein has begun talking to investigators, sources said.

With former associates caving in to intensifying investigations here and in Manila, the Marcoses have appealed to once-friendly foreign governments for refuge. So far, there have been no takers, although Panama flirted with taking them for $150,000 a week.

In the aftermath, almost everything about the Marcos era has taken on irony: monumental likenesses of him gazing out over Philippine golf links, and even a letter he sent Philippine taxpayers announcing a tax cut on the eve of the February election.

Written on official palace stationery, the letter closed with a thank-you for "the sacrifice you must make in contributing your share from your hard-earned money . . . . Your taxes have enabled us to be fed, dressed and housed much better than before."

Beside the Malacanang Palace letterhead was this warning: "Penalty for private or unauthorized use to avoid payment of postage, 500 pesos" ($25).