Andrew Perrie, 32, left two people in hospital following his actions in a lift at the Wellgate Centre in Dundee. He calmly then went into a Job Centre to pick up a form before leaving.
Emergency services, including experts in handling hazardous materials, were sent to the scene as people, choking and coughing, were evacuated from the building in October last year.
The full details emerged after Perrie, of Dundee, yesterday pleaded guilty to culpable and reckless conduct at the city's sheriff court.
He had used the noxious chilli spray called "Kiss The Devil" which is used to spice up food, after claiming to have found the device on a bus. The court heard he had let it off because he "wanted to smell it".
The incident sparked a multi-agency response with police, ambulance, firefighters and a hazardous materials unit rushing to the scene.
Two women were hospitalised, while several others, including children, were left ill as a result of inhaling the "noxious" gas.
After pumping out a cloud of gas from the canister, the court heard Perrie calmly collected a form from the Job Centre office and left the building.
Moments later several women and children were left vomiting and with breathing difficulties after inhaling the gas.
Fiscal depute Charmaine Gilmartin told the court he was traced after being captured on closed-circuit TV footage. She added that it showed him taking the cannister, which is similar in size to a police CS gas spray, out of a pocket. Taking the court through the footage, Ms Gilmartin added: "He proceeded to spray it around the inside of a lift before quickly exiting.
"A number of pumps were applied by the accused. He then gets out of the lift, collects a form from the Job Centre and leaves immediately.
"Then a number of staff, children and adults enter the lift itself and enter the area around it.
"They became affected by the then unknown substance.
"One was coughing uncontrollably and her eyes began streaming. She was helped to a window where she was then sick."
The court heard that another woman entered the lift with a child and three other females and soon afterwards started coughing and had problems breathing.
Ms Gilmartin added: "No-one knew what was going on so emergency services were contacted and an evacuation began. Around 150 members of staff in the building were evacuated.
"The two people previously mentioned were taken to Ninewells Hospital for further treatment.
"It was thought the symptoms were similar to CS spray and an exclusion zone was set up around the area."
The fiscal added: "He said he had found the spray on a bus and had initially sprayed it in his mouth and had then taken it to the Job Centre so he could spray it in the lift to smell it.
"The spray was called 'Kiss the Devil' and is intended to spice up food."
The spray is sold on the internet, where it is described as "off the scale" and "ultra insane" in terms of its spice level.
Perrie's lawyer, Brian Cooney, said he would reserve his plea in mitigation to a later date.
Sheriff Tom Hughes deferred sentence for social work background reports, but he warned Perrie: "These are obviously very serious offences and you are almost certainly facing a custodial sentence next time you appear."