Two other workers went to hospital for tests after complaining of sore throats, vomiting and headaches during construction of the new Kaimhill School in Aberdeen.
Work was temporarily halted on the project being built by Pihl UK while fire service investigators probed a possible chemical leakage.
It is understood the concentration of a solution the workmen were preparing was too high, causing the release of gas.
Aberdeen Royal Infirmary’s A&E department was closed to all but emergency admissions for just over an hour after the two men arrived because of fears of chemical contamination.
Grampian Fire and Rescue Service checked the school site to make sure the area was safe to continue working.
A spokeswoman told the Daily Record: “We were called out to a hazardous materials incident.
“One person had collapsed and several people were complaining of headaches. We cordoned off the area and made sure it was safe.”
An NHS Grampian spokesman added: “Two male patients presented at accident and emergency complaining of a burning sensation in the throat, streaming eyes, nausea, vomiting and headaches.
“They had been exposed to an unknown chemical.
“It was subsequently confirmed that the chemicals were of low toxicity. Both patients made a full recovery and have been discharged home.”
The school is being built by Pihl, on behalf of Aberdeen City Council, under the local authority’s public private partnership-funded 3Rs project.
A spokeswoman for the Health and Safety Executive said they were making inquiries into the incident.
An HSE spokeswoman said: “We are aware of the incident and we are making inquiries.
“The inspector is hoping to speak with the contractors as soon as possible.”