For 350 years the western world has exiled and confined its madmen. Now they are streaming out from behind the locked doors, returning to our cities and towns.

In the past 20 years, more than 400,000 patients have left the nation's public mental institutions. When Dwight D. Eisenhower was president and the new Plymouth had tail fins, 560,000 souls were locked up. Now there are 148,000, and soon more will be free.

Most are not cured, and few of the places to which they return are prepared to give them the attention they need. Still, most therapists agree, they are better off now than when they were "warehoused" in the 300 or so state asylums around the nation.

One of those asylums is Metropolitan State, a middle-sized institution near Boston. It is a huge, dark brick building atop a hill, its land skirted by woods. It is like others we remember from childhood, others we stared at as we drove by, wondering with dread what lay behind the tall bushes and black spiked fence.

The horrors that once existed there ae now acknowledged -- beds jammed sheet-to-sheet in the wards, scores of patients routinely blasted with electroshock therapy or chemically shocked with a large dose of insulin. Patients gained an additional sickness -- the institutional syndrome of slack-faced passivity and dependence -- just from being in this place.

Before the revolution, few ever left.

But many entered. "It used to be that all you had to do was look cross-eyed at someone, they would bring you in here feet first and you'd have a high chance of staying here the rest of your life," said Barbara Hoffman, regional mental health administrator at Met State.

Now, having someone committed to a public mental hospital is no longer a simple procedure, she said. And it is not determined by whether the patient is crazy.

"Now you can be mad as a hare and it doesn't mean you can be committed. You can be as insane as you wish to be, you can be fleeing from a plot against you by the Masons, but you cannnot be legally committed unless there is evidence, very strong evidence, of assaults or suicide attempts."

Nearly all the patients at Met State now commit themselves, and, unlike 20 years, ago, they may leave when they please.

So in Massachusetts, as in other states, the number of institutionalized mental patients has dropped drastically. In Massachusetts, the number of patients in state hospitals has dropped from 23,000 to 2,400. In California, the number has dropped from 37,000 to 3,000; in Maryland, from 8,100 to 3,000; in Virginia, from 10,000 to 4,700, and in the District of Columbia, from 7,000 to 2,000.

And now, Massachusetts is on the verge of abolishing state mental institutions.

It is the second revolution in the history of care for the insane.

The first came when madmen were released from their bonds and called patients instead of moral criminals. The second started with a series of chemical accidents, when doctors in the 1950s stumbled on three drugs that have powerful tranquilizing effects on the mind.

The drugs were the first -- and still virtually the only -- treatment for insanity that has proved to be widely useful. Practically from the day these drugs were brought into the hospital, the outward march of patients began.

A few were cured outright. Many became stable enough to live almost normally. But for others, the drugs were only a dose-to-dose relief from the storms of violence and delusion that swept through their brains.

They were all released into a community unready for them. They had few skills. For many, the blessed drug they used also carried a curse: it made them quake and drool involuntarily, it pulled their faces into stiff masks. They did not move easily back into the world.

Many states have tried to set up community treatment centers, residential centers and other such facilities. But, as a General Accounting Office report concluded, those facilities have not fulfilled their function. There has been little or no communication between the state hospitals releasing patients and the community facilities supposed to handle them. Tens of thousands of patients have slipped out of reach of either end of the line.

Society has greeted the returning exiles with sad acceptance, with fear, and even with violence and abuse.

Some patients who have gone from St. Elizabeth's Hospital here into group homes or boarding houses "are simply terrified," said Dr. E. Fuller Torrey, a psychiatrist at St. Elizabeth's.

"They are abused, or robbed of what little money they have, or raped, mostly by kids from the neighborhood of the homes. These things occur in many of the larger homes these people are sent out to."

In New York, thousands of the exiles roam the Bowery, the upper West Side and parts of Long Island. In California, the victims collect in the flophouses and alleys of San Jose, easy targets for abuse and robbery.

A backlash has occurred in many areas; there are demands to send the madmen back. But just as this reaction was beginning, the revolution entered a new phase.

In the 1970s, civil liberties lawyers began to win a series of cases that restored to patients rights stripped from them in earlier, eager attempts to treat mental illness.

Courts began to agree that patients have a right to treatment and a right to have it in the "least restrictive setting" -- that means in the community, not the hospital. Courts said patients have a right to be protected from easy commitment and a right to a tough standard under which only the truly dangerous could be committed against their will.

The door pried ajar by drugs was thrown widely and permanently open by the law.

Barbara Hoffman says she would be pleased to close Met State.

She was glad when a nearby state hospital lost a suit for, forcing it to close, forcing the state to care for its patients in the community rather than in "these old warehouses," as Hoffman called the hulking, mostly empty state hospitals.

Her attitude is typical among those who work with the insane now: they cheer for the patient in court suits against their own institutions. They know the courts can force state legislatures to provide money to set up the halfway houses and clinics to keep freed patients off the streets.

"At Met State, we once had 1,900 patients. Now we have 350," she said.

Now many of Met State's current patients would be admitted if they showed up at the door today?

"None. Or at least very few. If there were more facilities they could be out in the community," she said.

In Met State 75 patients are merely old and have no particular mental disorder. Forty have brain damage from head injuries, stroke or brain disease; 70 others are retarded. There are a hundred patients with acute attacks of psychosis, but most will be treated with drugs and soon released.

The rest are the sad cases, the ones who have been psychotic so long and here so long that they could not manage in the real world.

One man has celebrated his 104th birthday here, with half a century in the hospital. "TV wanted to bring a crew in here to film his birthday," Hoffman said. "I had to tell them it would be sad and useless. The man sits all day like a rolled-up blanket."

Massachusetts is now the best hope of mental health reformers.

Many states have released their insane and have tried to establish community programs, and each has faced the problem of thousands of patients who end up on skid row. In California, several gruesome murders by released mental patients began a backlash. In New York, one doctor said that "when the governor goes out campaigning he avoids some places in Long Island because he would get nothing but anger and questions about why the patients are on the streets."

But now Massachusetts is on the verge of abolishing its state hospitals, and selling the land where they stand.

Robert Okin, state commissioner of mental health, has proposed a new system of care based on general hospitals and group homes. To avoid losing track of patients, all those in a given part in the state are the responsibility of a single area director.

Okin's plan would put the least dangerous insane into group homes of about eight residents with a staff member, or into cooperative apartments in which four patients or so live in one unit of an apartment building and a pair of staff members live next door.

Since 1975, Massachusetts has opened 2,000 spots in apartments and homes, and hopes to open a thousand more.

For the more difficult patients, Okin wants to build small psychiatric units at many general hospitals in the area. So far 15 general hospitals have said they would be willing to build such facilities.

The most difficult and violent mental patients -- and there are only about 500 in the state -- would be placed in special buildings or wings on the grounds of private mental hospitals. The state would contract with the hospitals to provide the same high-quality care they now provide their wealthy patients.

The problem, Okin says, is that the full system would be more expensive than the old state hospital system. This goes against the expectations of state legislators, who in many states have hoped to save millions of dollars by closing state hospitals.

"But you cannot take a system that has been warehousing patients, and make out of it humane, first-class treatment system and still have it cost less," Okin said.

In many state budgets, mental health care is now first or second in all monies expended, even though the issue carries little weight on legislators' political scales.

California was the first state actively to attempt a massive return of mental patients to the community. Unlike other states, California did pour much of its state mental health budget into counties where the new community facilities would be run.

But even there, the problem remains of what to do with patients -- somewhere between 10 and 40 percent -- who have no families or homes.

They live on their own in rooming houses and hotels, where they get little or no supervision. They may stop taking their drugs and revert to earlier acute mental states. They may wander off.

To combat this, scores of little experimental homes and groups have been tried, such as the group that lived together and ran a restaurant, or the group that ran a plant store and nursery. In one, called The Lodge, eight patients lived together and ran a janitorial service.

But, as Dr. Robert Taylor of the state mental health department said, "These are wonderful ideas and they work well.But they are accidents. They are not built into the planning, they are not part of the state system."

Massachusetts is apparently the only state thus far to decrease its "revolving-door" readmissions. In the past four years Massachusetts' readmission rate has dropped 25 percent, according to Okin. The other states on the Eastern Seaboard averaged 11 percent increases in readmissions during the same time.

Curiously, community care for the insane, and particularly the plan in Massachusetts, is a return to the ethic of the Middle Ages: the insane stayed with their families, in their hometowns. Those without families were put into foster homes at municipal expense, or sent to the homes of relatives in distant towns, again at city expense.

Then came the age of the "great confinement," beginning about 1650, when mental patients were jailed and chained along with the poor and unemployed during a period of economic depression in France. When times improved, the poor were released to work, and the madmen inherited the institutions.

The first revolution in the care of the insane came more than a century later, when Phillipe Pinel led a movement to place them in hospitals in the countryside, in asylums where they could be released from chains and handled like the physically ill.

But, lacking effective treatments, those institutions soon turned into the warehouses that later appeared in America. As no useful treatments emerged, the population of public asylums grew steadily until 1955.

Then came the second revolution in the treatment of the insane, the psychoactive drugs.

What made the discovery so revolutionary was that it was the first time in the long, sordid history of the handling of the insane that anything proved to be a useful treatment.

The elation of the time has since given way to a greater awareness of the powerful side effects of the drugs, and the fact that 10 to 20 percent of patients are not helped. And it is also clear the drugs relieve the symptoms but do not cure the illness.

And there is the center of trouble, said St. Elizabeth's Torrey. For centuries the insane have been observed, moved, poked, chained, beaten, shocked, injected -- but still there is no cure for their sickness.

"There have been profound changes over the years in the way professionals think about these people, and now increasingly we see chronic mental patients as people with damage done to their brains by real disease. They are not sick because of anything they did, or how their mothers treated them. They are sick because they became affected with something that changed the chemicals in their brains," Torrey said.

"Essentially we will treat these people according to what we believe," Torrey said. "If you believe that poor SOB is there in the hospital because a virus passed through his mother's uterus at the wrong moment, and that it could just as well have been you infected, then you may treat him as an unfortunate fellow.

"And if he can get well enough to live in the community, then that's emotionally something you can accept, and live with . . . ."