The Maryland General Assembly, capping a workmanlike 1985 session with a productive last day, gave final passage today to legislation granting Citicorp, the giant New York bank holding company, the right to expand in the state and to a bill banning the sale of phosphate detergents.

The legislature also gave final passage, known as enactment, to a package of bills proposed by Gov. Harry Hughes that is designed to slow the escalating cost of health care in Maryland. Enactment of the bills, which Hughes had made a major legislative priority, came after a conference committee resolved a lingering snag over legislation to regulate the purchases of expensive equipment by doctors and hospitals.

In approving the four-year ban on the sale and distribution of phosphates, the legislature overcame a furious lobbying campaign by industry. The ban will take effect in December.

After a conference committee removed a number of exemptions added by the House that would have allowed the use, but not purchase, of the detergents by homeowners with septic systems and customers of coin-operated laundries, the bill was approved 36 to 8 in the Senate and 85 to 47 in the House.

In removing those two exemptions, the legislature approved in their place language directing the state secretary of health to determine if the ban imposes a hardship on septic system owners and coin-operated laundry customers, and giving that official the authority to implement the exemptions by regulation if there is such a hardship.

In the final minutes of the session tonight, the legislature enacted a measure barring the state from making any new investment of pension funds in any company that does business in or with South Africa for a period of one year beginning in July.

Moving methodically through a last-day calendar that contained more than the usual number of big-ticket items, the legislature cleared the so-called Citicorp bill in early afternoon as the House passed, 108 to 16, a measure identical to one that had earlier been approved by the Senate.

The Citicorp bill -- bitterly opposed by Maryland bankers -- implements an agreement forged by Hughes more than a month ago with the New York bank under which the financial conglomerate will establish a credit card center in Hagerstown and a total of 1,000 jobs in the state in exchange for receiving broader banking authority.

Under the legislation that now goes to Hughes for his signature, Citicorp and other large out-of-state banks that agree to the same economic development terms can set up as many as 20 branches in the state before 1988, after which there would be no limit.

A companion banking bill that would establish by 1987 an open-ended period of regional banking between Maryland, the District of Columbia and 14 other states including Pennsylvania also was enacted, passing the House 107 to 16. The legislation would permit banks in the region to cross state lines to merge with or acquire Maryland banks. Citicorp, based outside the region, would not be able to acquire other banks.

The health care package faced little opposition in its final form, which differed substantially from what Hughes originally sought.

The one sticking point, resolved today, concerned how the state would regulate the acquisition of medical equipment worth more than $600,000. Hughes had asked the legislature to make physicians go through the same regulatory review, called a certificate of need process, required of hospitals. But in conference committee today, the Senate prevailed with its version of the legislation, which sets up a new streamlined licensing procedure for both hospitals and doctors that removes them from the process altogether.

Several of the governor's health care proposals -- including a revenue cap for hospitals and a measure giving the governor pemanent authority to freeze the certificate of need process under which hospitals apply for expansions -- were rejected outright.

But other parts of the package survived, and in some cases were improved. From now on, hospitals will have to establish so-called "utilization review" programs as a protection against unneeded care, and they can be forced to close if they do not voluntarily consolidate or merge services to reduce an excess statewide bed capacity estimated at 4,100 beds.

As the day progressed, some legislators congratulated themselves for a harmonious 90 days.

"It was a very productive session," said House Speaker Benjamin Cardin. "Though it was not filled with flair or drama, people got a full dose of strong, creative legislation that bodes well for the quality of life in Maryland."

But others had a sense of opportunities lost, and of unease at the domination, particularly toward the end, of special economic interests.

Said state Sen. Norman R. Stone (D-Baltimore County), "I have mixed emotions about this session. I don't have much to go back to my district and talk about. It's been a real special interest session. It was banking; it was racing."

"Usually we end a session, despite the disappointments, with one great big positive thing," added Del. Helen Koss (D-Montgomery). "This year, I haven't found it." Koss said that Maryland's strong tradition of enacting legislation for the environment, the consumer and for open government had been eroded this year by passage of bills legalizing the limited use of slot machines, easing strip-mining laws and removing price as a factor in state architectural contracts.

Earlier in the day, the Senate enacted three of the most controversial items in Hughes' so-called "youth initiative" package that are aimed at stemming child abuse.

One bill would allow judges to use closed-circuit television in obtaining testimony from child abuse victims. The second allows the courts to remove an alleged abuser from the home instead of the child victim. Under a compromise between the two houses, the abuser can only be removed for 40 days before the case must again be reviewed by the court. The third, and least controversial, establishes new procedures for locating missing children.

Also enacted were measures that tighten laws on child pornography and that permit very young victims to testify in child abuse cases. The legislature gave final approval to a bill requiring judges to withhold funds from the paychecks of people in arrears on their child support payments. It stripped from that bill a controversial House amendment that gave judges wide latitude in deciding whether to attach the funds.

Though the session was considerably calmer than in 1984, a final day with so many big issues at stake did produce some discord.

This afternoon, for instance, a House-Senate conference committee meeting to resolve differences over the $220 million capital budget broke up abruptly when the three House members stalked out on their Senate colleagues. The senators had refused to agree to language that would give the legislature some say in the location of a proposed "supermaximum" prison facility.

The House, earlier in this session, had pressed for construction of the 300-bed prison in Hagerstown, but eventually gave up the fight in the face of the governor's and Senate's preference for Baltimore. But the House included in its version of the capital budget funds only for site preparation work, and wrote in language that would hold up design and construction funds until House members receive additional information on future operating costs.

When the three senators in conference balked at the House language, Del. R. Clayton Mitchell Jr., (D-Eastern Shore), the chairman of the House Appropriations Committee, led his two conference committee colleagues from the room. "I'm feeling nauseated, let's go," he said.

That difference ultimately was settled, with the conference committee agreeing to the House language with minor changes.

As the legislature headed toward its midnight adjournment, the capital budget was enacted. It included $2.9 million for Montgomery County schools and $1.6 million for the Prince George's justice center in Hyattsville.

Prince George's senators also continued a 90-day dispute to the final day with Sen. Thomas V. Mike Miller Jr. holding up a measure to expand the county's elections board, despite the approval of the House and a narrow majority of the senators. Miller refused to send the bill, drafted to allow another black member on the present three-member board, to a committee with authority to relay it to the floor, killing it.

Hughes, who proposed in January a legislative program and budget with broad popular appeal, got nearly everything he wanted out of the General Assembly. A year before he is expected to run for the U.S. Senate, Hughes faced none of the acrimony he encountered in 1984, when he and the legislature feuded repeatedly over budget matters.

"The governor," concluded Del. John Arnick (D-Baltimore County), "used the influence of his office to a much better extent than he has before."

The governor's $7.5 billion budget, containing more than $200 million in new spending programs fueled by $625 million in new revenues and a modest surplus, emerged virtually unscathed. Despite a brief but heated dispute over an across-the-board cut by the Senate Budget Committee that was ultimately overturned, the legislature cut only $29 million.

The final document contained largely what Hughes had sought, including a $76 million pay increase for state employes, $11.3 million in welfare grant increases and about $11 million worth of programs attacking child abuse, foster care and other problems of the young.

One item of controversy on the budget, as always, came over the question of state funding of abortions for poor women. The legislature, for the second time in three years, rejected a Hughes proposal to liberalize funding guidelines, retaining an uneasy compromise that has existed for the last five years.

Hughes was successful in getting the legislature's approval for a $12 million tax break intended to revive a state racing industry that is increasingly threatened by more innovative tracks in other states that have benefited from state assistance.

The legislature was inconsistent on environmental issues, enacting legislation that was bitterly opposed by environmentalists to allow strip mining of coal on slopes angled more than 20 degrees. Hughes has suggested he may veto that measure.

But environmentalists won a victory when the legislature refused to allow utility interests the authority to construct a coal slurry pipeline from West Virginia to the Chesapeake Bay.

The legislature sent conflicting signals on on public gambling questions this session. Legislation to restrict gambling activities by fraternal, religious and other nonprofit groups was severely watered down in the face of overwhelming public opposition and died.

"We have about three pages of bills that we're just not going to get to and they all just happen to come out of the House Judiciary Committee," said Sen. Miller, who made no secret of his intention to kill the gambling bill sponsored by House Judiciary Chairman Joseph E. Owens (D-Montgomery).

At the same time, the assembly enacted a bill legalizing the limited use of slot machines by nonprofit groups on the Eastern Shore. Hughes, saying he is "not comfortable" with that legislation, will decide on whether to veto it later this spring.

Bucking a trend in some other states, the legislature refused to adopt legislation requiring motorists to wear seat belts, despite pressure from the federal government and auto manufacturers.