PANAMA CITY -- When Ni Guo Hua came here from Guangzhou, China, last September, his intention was to stay just long enough to buy false Panamanian citizenship, obtain a passport and fly to Hong Kong to set up a business there.

After paying $10,000 in Hong Kong for a visa to Panama and airfare, he said, he made a down payment here of $9,000. For that he got a cedula, or ID card, that identifies him as a Panamanian -- although he does not speak a word of Spanish -- and allows him, among other things, to vote in Panamanian elections.

But before he could complete the $12,000 deal that was to culminate in the prized Panamanian passport, the U.S. Army thwarted his plans. By ousting Gen. Manuel Antonio Noriega, it scuttled a vast immigration scam estimated to have netted more than $300 million in the last five years.

Now Ni Guo Hua is among thousands of Chinese, Cubans and a smattering of other nationalities -- notably Libyans -- who are stuck in Panama after having paid thousands of dollars to the Noriega regime for visas and false documents.

According to immigration officials, diplomats and sources in the Chinese community here, almost all of the Chinese would-be immigrants came through Hong Kong. Among them, the sources said, are entrepreneurs who have grown rich from China's economic opening and -- since the turbulent events surrounding last year's massacre around Tiananmen Square -- the children of some senior government and military officials.

Most have come here with the aim of moving on to another country. But some have settled in Panama and established restaurants, night clubs and casinos that cater mostly to other Chinese, as well as travel agencies that serve as fronts for a retail trade in Panamanian documents.

Involved in the profitable human trafficking, the sources said, were close associates of Noriega, including a cousin, Ciro Noriega. He served as Panama's consul general in Hong Kong until the new government here dismissed him shortly after U.S. forces invaded the country Dec. 20.

Aurelio Chu Yee, Noriega's former martial-arts instructor, collected huge sums from sales of visas and shipping permits at inflated rates while serving as consul general in Taiwan, Chinese and Panamanian sources said.

Also closely involved in the scam, sources said, were the former immigration director, Belgica de Castillo, and Noriega's longtime top aide, Maj. Rafael Cedeno, who headed the G-2 military intelligence branch at the time of the invasion. Both sought refuge with Noriega at the Vatican's embassy here, then surrendered to U.S. forces.

According to records found in Panama's Immigration Department after Noriega was deposed, 42,687 Cubans and 20,537 Chinese had arrived here since 1985 under a scheme estimated to have made at least $315 million from visa sales alone. The sale of at least 2,500 passports to Chinese over the last several years brought in $30 million more, Chinese sources estimate.

Noriega and members of his Panama Defense Forces (PDF) general staff are believed to have received a large share of the take, immigration officials said, but exactly how much is not known.

"All the visas were controlled by Noriega or the PDF," said Jose Chen Barria, the new director of the Immigration Department. "Nothing was done without the knowledge of Noriega."

The broad outlines of the scheme were revealed in 1987 when Col. Roberto Diaz Herrera, ousted by Noriega as second-in-command of the PDF, said that sales of visas to Cubans had paid for his luxurious villa near Noriega's own house in an exclusive Panama City neighborhood.

Most of the Cubans have since made their way to other countries, mainly the United States, Chen Barria said. About 2,000 to 4,000 remain in Panama, he said. They have formed an association to lobby for permission to emigrate to the United States, where many have relatives.

The case of the Chinese is more complicated, Chen Barria said, in part because they are more numerous, generally fear legal formalities and speak no Spanish. He said that about 10,000 Chinese citizens are currently believed to be in Panama, in addition to about 100,000 Panamanians of Chinese origin, nearly 5 percent of the country's 2.2 million population.

Chen Barria, himself of Chinese ancestry, said in an interview that when he was named immigration director last month, he found some 10,000 Chinese passports in the department's downtown headquarters. Many are believed to belong to recent arrivals whose original passports were retained by immigration. Others may belong to Chinese who have already acquired Panamanian passports and left the country, Chen Barria said.

Besides the sale of Panamanian visas and passports, the immigration scam spawned a vast industry here that included lawyers and middlemen and the manufacture of false documents.

According to Chinese sources, at least 37 immigrants from mainland China have emerged as key go-betweens in the sale of Panamanian passports and related services, and some of them have become millionaires.

Evidence of the wealth -- and of the plight of those who now are stuck here -- can be seen at popular Chinese restaurants where the immigrants gather daily for breakfast. Among about 200 Chinese who filled the Lung Fung Restaurant one recent morning, Neal T. Kuo, a correspondent for the Hong Kong-based Asiaweek magazine, pointed out established entrepreneurs, some accompanied by bejeweled young women. One wealthy middleman was busy giving orders on a walkie-talkie.

Generally, sources said, the immigrants' aim is to set up a company in Hong Kong to do business with China. Although Chinese from the mainland are limited to a seven-day stay in Hong Kong, Panamanians in effect can remain indefinitely if they travel out of the colony every three months.

According to Hu Tairan, bureau chief here of Beijing's official New China News Agency, most of the would-be immigrants come from Guangzhou and Shanghai. Some, he said, even return to China and use their Panamanian passports to get preferential treatment as "overseas Chinese." Others go to Canada, Australia and the United States, he said, sometimes crossing the U.S.-Mexican border as illegal aliens after paying smugglers thousands of dollars to take them up through Central America.

Many are naive and easily cheated, Hu Tairan added. He said one recent victim here, the son of a senior Guangdong provincial official, made a large payment to a Panamanian immigration lawyer, who then claimed not to recognize him.

Other Chinese officials whose sons have come to Panama include a vice minister in Beijing, a Bank of China branch president in Guangdong Province, several high-ranking officials in Shanghai and at least three senior military commanders, sources in the Chinese community said. In some cases, they said, the mission is to set up foreign businesses into which kickbacks can be paid for corrupt deals in China.