Federal regulators wrapped up the final rescue packages for insolvent savings and loan associations Saturday, completing bailout deals for all of 1988 that will likely cost the government in excess of $38 billion.

In just the final 48 hours of frenzied negotiations, the Federal Home Loan Bank Board accepted packages that provided almost $5 billion in assistance, the bulk of that coming in $3 billion-plus bailouts involving some of the sickest S&Ls in the country.The number of insolvent S&Ls closed by the government and taken over by new investors totaled 216 by late Saturday. That put the total number of failed S&Ls at a 50-year high, exceeded only by 277 institutions that were closed in 1938 during the Great Depression. By contrast, only 48 institutions were closed in 1987.

Four of the institutions closed on the final day of 1988 were in California, one was in Florida and another was in South Dakota.

Attorneys representing the government and the purchaser haggled for most of the day over the Florida deal, in which the government agreed to inject $151.1 million in aid in the purchase of the insolvent Broward Federal Savings and Loan of Sunrise, Fla., by a subsidiary of the Los Angeles-based California Savings and Loan Association.

As the witching hour of midnight approached, negotiators were still involved in discussions concerning one final S&L rescue package. Officials of the bank board refused to provide any details about which S&L was involved or what the prospects were for reaching settlement.

The rush to reach agreements as the clock ticked away on 1989 was spurred by a year-end deadline that would cut tax breaks in half for purchasers.

Bank Board Chairman M. Danny Wall said he believed the deadline had been a good thing for the government in its effort to finally close the books and stop the hemorrhage of funds at S&Ls that have been technically insolvent for years.

He said the shutdown of the sick S&Ls should have a beneficial effect on the industry as a whole by lowering the cost of funds for healthy institutions that had been competing against the high rates weak S&Ls were forced to pay to attract depositors.

Wall defended his agency against charges by critics that the agreements represented "sweetheart deals" that had been unnecessarily generous to the buyers, who have included such wealthy investors as Texas billionaire Robert Bass, Revlon cosmetics chairman Ronald O. Perelman and the Ford Motor Co.

"These are not precipitous actions," he said. "This has been a very extensive and exhaustive process" culminating in the final decisions.

Wall said the cost of simply closing down the S&Ls and paying off depositors up to the $100,000 insurance limit would have been far more expensive than the $38 billion in projected costs for all the agreements reached in 1988.

But the S&L crisis will present President-elect Bush with one of his first headaches as he is forced to come up with ways to boost government spending to clean up the mess while at the same time trying to fulfill his campaign pledge of lowering the budget deficit without raising taxes.