A dangerous mixture of cleaning agents led to the evacuation of the Plymouth County Superior Court in Brockton Friday morning as toxic fumes spread through the building.

“Tears were streaming, people were gagging. It was terrible,” said one witness who did not want his name to be used.

Fire officials reported that a janitor, attempting to unclog and clean a toilet in one of the second-floor holding cells, mixed bleach with another cleaning product that contained sulfuric acid, which created a toxic vapor.

Court employees described the fumes as having a strong ammonia, chemical odor.

Hazardous materials experts, police, fire crews and ambulances raced to the scene, and the courthouse was evacuated shortly after 10 a.m.

Three court officers were taken immediately to the hospital as a precaution. Eighteen prisoners were among those evacuated.

Four fire trucks and a half-dozen squad cars blocked off the block of Belmont Street on the edge of downtown that the large, three-story, stone building occupies. Emergency responders set up an industrial fan at the front door to blow fresh air inside.

The courthouse remained closed for the rest of the day Friday, but officials say it will be ready for the start of business by 7:30 Monday morning. A jury was deliberating a murder case before the evacuation.