Argentina, which has sparred with its foreign creditors for nearly two years, last night reached a complicated settlement with its key bank lenders that will provide $4.2 billion of desperately needed cash in 1985, the banks announced.

Moments after the announcement, the U.S. Treasury said it was prepared to lend the country $500 million to tide it over until it can get cash from the banks and the International Monetary Fund, the multinational financial rescue agency that has tentatively agreed to lend Argentina $1.4 billion.

The agreement, reached in New York City, also allows the country to stretch out repayment of $13.4 billion in debts that already have come due or will by the end of 1985.

The settlement, which still must be approved by Argentina's 320 bank lenders, brings to a close the first round of the Latin American debt crisis, which began in August 1982 when Mexico announced that it no longer could pay its loans on time.

Since then, Mexico, Brazil and Venezuela have taken austerity measures to reduce their inflation, their government spending, and their need to rely on foreign borrowing. Most of these adjustment programs caused severe recessions in the debtor countries.

Argentina, in its last year of military rule in 1983 and its first year of democracy in 1984, found it difficult to take such austerity measures. As a result, Argentina has received no loans since late 1982 and its borrowings have fallen severely in arrears.

U.S. banks have been forced to put many of them on their problem loan lists.

As part of last night's settlement, Argentina agreed to make a large part of these overdue payments by the end of this month and the rest by the end of June.

In September, Argentina and the IMF finally agreed on an economic program designed to reduce the country's raging 700 percent inflation, cut its budget deficit and boost its exports to produce needed foreign exchange.

But the IMF said that before it would lend Argentina $1.4 billion, the country's creditor banks had to agree to lend the country new money and stretch out repayment terms on maturing debts.

Most of the banks are in the United States, Europe and Japan. All told, Argentina owes foreigners -- banks, governments and multinational institutions -- about $45 billion. U.S. banks hold about $9 billion of the $30 billion in bank loans.

The bank advisory committee, headed by Citibank Senior Vice President William R. Rhodes, announced last night that the 11 banks that negotiated with Argentina recommended to all its lenders that they provide $4.2 billion in new funds and restructure into 10-year and 12-year loans the $13.4 billion of Argentine loans that are maturing or have done so.

The terms on the loans are far more favorable than Mexico or Brazil could negotiate in their initial agreements with bank lenders in late 1982 and early 1983 but are not as favorable as Mexico received in August -- when the banks "rewarded" that country for its efforts. Mexico can now stretch out over 14 years the repayment of nearly all its outstanding bank debts.

Argentina still must negotiate terms on debts that come due after 1985.

"The settlement doesn't break the mold" of continuing bank concessions, said one top U.S. official. "It's a fairly good deal for Argentina. But the banks do not have the economic performance there to reward Argentina as they did Mexico."

The Treasury said it would not disburse its $500 million temporary loan to Argentina until the bulk of the bank lenders agreed to last night's settlement.

Rhodes said the committee hopes that the banks will approve the agreement by Christmas and said details will be sent to the banks today.

New York bankers have said that getting approval for an Argentine settlement could be difficult because the country has taken so long to come to terms with both the IMF and the banks and because of the large interest arrears.

The Treasury will be repaid when the International Monetary Fund makes a payment to Argentina.

The banks said that on the $4.2 billion of new money Argentina will pay an interest rate of 1 5/8 percentage points over the London Interbank Offered Rate (Libor) a rough approximation of the cost to banks of raising funds.

In their early settlements with bankers, Mexico and Brazil paid more than two percentage points over Libor, although in Mexico's latest settlement, the rate was just over one.

On the $13.4 billion in renegotiated debts, Argentina will pay 1 3/8 percentage points over Libor. There is a grace period of three years during which Argentina must pay only the interest.