Eighty-seven Cuban refugees were evacuated yesterday evening from a building at St. Elizabeths Hospital after 17 of them took over the building in a third day of disturbances involving the refugees.

The refugees had been brought here last week for evaluation and treatment of mental and emotional problems. During yesterday's takeover, the 17 reportedly smashed windows and furniture and threatened staff members. No injuries were reported.

After all 87 finally left the building voluntarily in response to orders issued in Spanish over a bullhorn, they were handcuffed, searched and placed aboard waiting buses. The 17 men who took over the building, along with two women also identified as troublemakers, were flown to federal prisons for further psychiatric evaluation, officials said.

The other 68 refugees, who emerged from the two-story brick building into an area filled with helmented D.C. and federal law enforcement officers, were taken to another building on the hospital grounds to wait until the building they had occupied originally could be cleaned and repaired.

After two previous days of disturbances at Building B, a building leased by the U.S. Immigration and Naturalization Service as part of the Cuban refugee program, matters began to come to a head yesterday when the 17 Cubans took over part of the building's first floor about 11 a.m.

The Cubans ordered staff members out of the occupied section, and the staff members moved from the area, according to Dr. Larry Silver, coordinator of health programs for the Cuban entry program.

At first, Silver said, it was possible to confine the 17 to that section of the building. But by 1 p.m., the Cubans had made their way out and began breaking windows and furniture and threatening staff members elsewhere in the structure.

"At that time," Silver said, "I didn't feel it was safe for my professional staff and I ordered them out of the building."

According to accounts, the Cubans had fashioned some makeshift weapons out of such materials as bedsprings and broken glass.

In a brief skirmish in the afternoon, D.C. police officers scuffled with and seized one Cuban who came out of the buidling and appeared to be trying to leave the grounds. Three other Cubans emerged with jars of yellow paint, which they splashed on some of the officers. The police responded by firing two canisters of tear gas, forcing the Cubans back inside.

From upper-story windows and balconies, Cubans heaped verbal abuse on the police below, occasionally adding a "Viva Castro" to their shouts.At least one of the Cubans, however, shouted "Viva America."

Yesterday's turbulent events followed an outbreak Sunday in which some of the Cubans took over the building briefly, smashing windows, destroying furniture and setting a small fire before security guards brought the situation under control. In addition, sources said yesterday that an initial disturbance occurred Saturday night, after which five Cubans were removed from the building and taken to a more secure facility on the hospital grounds.

By yesterday evening, with as many as 300 uniformed and helmeted law enforcement agents assembled in front of the building to provide a "show of force," Silver said, staff members using amplifiers called on the Cubans to leave the building, and one by one, without apparent incident, they did.

In addition to smashed furniture and broken windows, authorities who entered the building last night found that floors had been flooded, paint had been splashed on walls, medical supplies were strewn about, file cabinets had been pried open and files ripped apart.

The Cubans, among the 126,000 refugees who came to the United States this year from their island homeland, were brought here last week after the camps in Wisconsin and Pennsylvania at which they had been housed were closed because they were not winterized.

In discussing the reactions of the Cubans who were brought here, Sivler noted that most were in their 20s, had been brought up to be fearful of the United States, and likely had been sent to this country against their will, without ability to speak English and with no idea what faced them.

The problems here follow a series of disturbances involving Cuban refugees, including one last summer at Fort Indiantown Gap, Pa., in which two Cubans were critically injured and about a dozen military policemen suffered minor injuries as about 300 refugees stormed barricades and threw rocks and bottles in what one refugee center official characterized as a "riot."