Charging that the government of Anastasio Somoza looted the treasury before fleeing abroad, Nicaragua's new rulers have declared all large-denomination national currency to be worthless as of this Monday.

Thousands of Nicaraguans lined up at banks today to exchange the bills before the deadline and the government closed the country's borders to prevent exiles from returning to exchange bills they took with them.

While the junta-issued decree sent many Nicaraguans into near-panic at the thought of even temporarily giving up savings at a time when both money and goods are in short supply, government sources indicated that further announcements would provide relief, especially for lower-income groups.

Nicaraguans were given today and Sunday to turn in all 500 and 1,000 cordoba bills, worth about $50 and $100, to state banks. In exchange they receive not currency but certificates of deposit that cannot be redeemed for at least six months.

The government said the currency decree, which was kept secret until its announcement by a radio broadcast late last night, was necessary because the previous rulers had stolen as much as $30 million worth of the large-currency bills.

Junta member Alfonso Robelo said the government wants to prevent emissaries of officials in Somoza's regime, who are now in exile, from coming here to spend their allegedly illgotten gains. The government also fears the exiles may use the Nicaraguan cash to destabilize the country through inflation, he said.

In partially sealing the borders for the two-day period, the junta canceled all commercial air traffic, although land borders remained open.

The decree said that some of the bills, new money whose serial numbers were registered at the Central Bank, were now circulating outside the country. Others, which the decree said had been sold locally at blackmarket rates for dollars by the thousands of Nicaraguans who fled during the final days of Somoza's rule last month, reportedly already have appeared in circulation within Nicaragua.

To collect the stolen money and permanently prevent its use, Robelo said in an interview, the junta decided to take all large-denomination bills out of circulation.

Robelo also acknowledged, however, that be exchanging the large bills for deposit notes rather than for cash in smaller denominations, the government conceivable could add as much as $35 million -- the estimated amount of legal and nonlegal large bills now inside Nicaragua -- to the national treasury.

Since the government will consider the bills legal tender as long as they are in the treasury, they will contribute to the government's on-paper bank balance. While the government cannot convert the money into hard currency, it can use it to extend needed local credit to farmers and businesses.

In that way, Nicaragua's hard currency reserves -- which are reported as having increased from barely $3 million when the junta took over July 20 to a still minimal $57 million as a result of foreign loans -- can be used to purchase imports.

By early this morning, thousands had gathered in long lines outside Nicaragua's recently nationalized banks. Many expressed strong opposition to the decree.

Some businessmen predicted a severe cash-flow problem. Many individual Nicaraguans had withdrawn their savings, often in large denomination bills, from local banks when civil unrest erupted into war several months ago. They are now forced to turn them in for a piece of paper unredeemable for six months, when the government says the money will be repaid with 8 percent interest.

Most Nicaraguans have only begun to work again after months of war related unemployment. Some said they had received their first pay -- often in large bills -- only last week.

Hundreds of others found their travel plans interrupted. Surprised airlines telephoned those with plane reservations early this morning to say flights had been canceled. News of the decree has been closely held in government circles until last night's announcement, apparently to prevent a rush to exchange the bills for smaller ones.

This afternoon, an angry crowd of approximately 200 gathered in front of the junta's downtown office, chanting "Exchange yes, deposit no." Although a government official came out to speak with them, he told them nothing could be done today and advised them to deposit their money before the deadline passed.

Other officials told reporters, however, that the junta was considering providing relief through early note redemption or other means, for those who could demonstrate an urgent need for the cash.

Although junta members said they had expected a negative reaction, they said they were taken by surprise by the large numbers of lower-income people turning in relatively small amounts of money. They asked for trust, and emphasized that the move was designed to apprehend those who had obtained illegally large quantities of the bills.

They declined specifics for fear of providing the alleged criminals with a loophole, but suggested strongly that there would be further announcements by the beginning of the week in what appears to be a complex, step-by-step plan.

They said the large denomination bills will not be redistributed, but stressed that lower-income groups and legitimate local businesses will be protected.