The Maryland Senate dramatically enacted legislation early this morning that permits Chase Manhattan Corp. to acquire three savings and loan associations and that encourages other out-of-state banks to move into the financially lucrative Maryland market if they acquire one of three other ailing large thrifts.

The Senate vote at 3:57 a.m., which followed a much more resounding vote in the House about an hour earlier, represented a capitulation to Gov. Harry Hughes, who has struggled over the last five months to end the state's thrift industry crisis.

Senators wrung some minor concessions out of the Hughes administration, including a reduction in the sale's impact on a state-controlled thrift fund.

"The last few days have been very trying," Hughes said at 4:30 a.m. "But we've come out with a big step toward solving the savings and loan problem in Maryland."

Hughes is expected to sign the legislation once he has received certain financial agreements from the stockholders of Friendship Savings and Loan of Bethesda and Chesapeake Savings and Loan of Annapolis, which along with Merritt Commercial Savings and Loan of Baltimore will be purchased by Chase.

Once the legislation is signed, Hughes said, he will allow depositors at Friendship and Chesapeake to withdraw $1,000 per account, each month.

By early November the 13 branches of Merritt, Chesapeake and Friendship will be transformed into the Chase Bank of Maryland and all 70,000 customers will regain full access to their $500 million in deposits.

The governor also extended for another 30 days a freeze on withdrawals at one of the other three large troubled thrifts, First Maryland Savings and Loan of Silver Spring.

Acquisition talks between First Maryland and a Maryland subsidiary of Citicorp, another giant New York bank, collapsed 13 days ago.

Hughes said he will allow First Maryland's 34,000 depositors to take part in a plan that will soon be in effect at the other two thrifts, Old Court of Baltimore and Community of Bethesda, which allows their depositors to withdraw money for certain hardships, including emergency medical care, college tuition and some real estate settlements.

The denouement of the Chase Manhattan melodrama that has mesmerized state government since last Wednesday came at the end of an 18-hour day during which Hughes had personally begged the legislature to approve the transaction.

The Senate eventually bowed to Chase's insistence on a $25 million payment from a state insurance fund for taking over debt-ridden Merritt. It agreed to a compromise that gives the state some, but not exclusive, right to sue Merritt owner Gerald S. Klein for civil damages.

It also accepted an administration proposal that the state share Klein's potential profits from four properties the Merritt owner will retain. Some senators had wondered why Klein, who they believe contributed to Merritt's problems, should get anything at all.

One other concession the Senate got was an agreement from executives at Chesapeake and Friendship to contribute $4.4 million to the Maryland Deposit Insurance Fund, the same fund from which Chase's $25 million comes.

Hughes had told the executives their contribution was the only way to appease Senate concerns over what some said were high prices being paid by Chase to Friendship and Chesapeake stockholders at the same time the state was paying Chase $25 million.

"Harry said this was the last chance for this thing to go through. We had no choice," said Chesapeake President Arthur Silber.

Employes at Chesapeake already were getting ready today for their expected conversion into a commercial bank. "We've already ordered rubber stamps and letterheads," Silber said.

Chase's conversion of the three savings and loans into a full-service subsidiary will give the $86 billion banking giant a solid foothold in Maryland's finance industry, which faces radical changes and heightened competition as it rapidly enters an era of national interstate banking.

Chase also will be able to acquire other financial institutions once it is operating within the state.

The legislature's actions this morning could bring additional out-of-state bankers into Maryland, but only at the price of helping ease the thrift crisis by acquiring Old Court, First Maryland or Community, which have not yet won federal insurance.

A companion measure to the Chase legislation removes from the books a law passed in May that had allowed limited interstate banking here in exchange for meeting certain job-creation and investment requirements.

Citicorp, which already is setting up a banking operation in western Maryland under that law, will be allowed to stay.

The Senate's vote capped a topsy-turvy five-day session that included two marathon meetings in the last three days that extended close to dawn and threats as late as Monday to filibuster the legislation in the Senate.

The pivotal vote followed extended closed-door negotiations involving Senate President Melvin A. Steinberg (D-Baltimore County), House Speaker Benjamin L. Cardin (D-Baltimore), the governor and his aides.

Hughes hastily arranged a speech to the legislature on Monday night, in which he begged the assembly to endorse a deal he conceded "isn't perfect" and revealed the minor concessions. The speech appeared to stem the tide of Senate opposition to the Chase transaction.

At the very least, it was enough to persuade Steinberg to begin swimming in the other direction.

The Senate president, whose stance opposing the deal last Wednesday angered Hughes and whose subsequent reversals and counterreversals perplexed the administration and the House, went to work about midnight to sell the compromise to his skeptical colleagues.

First in a conference committee, and then for several hours in his office and on the floor of the Senate, Steinberg wheedled and cajoled his way to 29 votes, the minimum necessary to pass an emergency bill.

Aided by Hughes, who brought senator after senator to his office on the second floor of the State House, Steinberg achieved his majority -- the vote was 29 to 14 -- at 3:30 a.m.

"It was as much Mickey as the governor," said Sen. Frank J. Komenda (D-Prince George's), who became the 29th vote to fall into place after meeting with the governor. "Mickey was bleeding. I guess we all were bleeding some."

"Mickey asked for my vote as a personal favor and I gave it to him," added Sen. Julian L. Lapides (D-Baltimore), who still called key elements of the transaction "outrageous."

With the votes in hand, Steinberg finally called the roll as a hush fell across the Senate's marbled chamber. Even then a malfunctioning of the mechanical vote recorder caused a "for" vote by Sen. Arthur Dorman (D-Prince George's) to be cast as a vote against the measure, and the Senate had to revert to a method not used regularly in two decades, a voice roll call.