The officer was left hallucinating and became violent after being exposed to toxic fumes from psychoactive substances at HMP Shotts in north Lanarkshire in 2019.
He has since suffered long-term health problems and brought a civil claim against the SPS, which was settled out of court.
BBC Scotland reports that compensation was paid to the officer, with a spokesperson adding: “The health, safety, and wellbeing of all those who live and work in our establishments is a key priority for SPS.
“The presence of illicit substances in the wider community is a constant challenge and we continue to work hard to safeguard staff, and those in our care, from the harm they cause.”
Drug taking amongst inmates is one of the biggest problems in Scottish prisons, with concerns raised about wardens being exposed to second-hand smoke from popular substances such as Spice.
Data collected by the Scottish Conservative party in January 2023 found the number of prisoners caught with drugs had increased by 1100 per cent since 2014.
The most common way to smuggle psychoactive substances was to spray them onto pieces of paper being posted to inmates, with the SPS starting to photocopy mail in 2021 in a bid to stop the flow of drugs.
Meanwhile, £75,000 worth of drugs, knives and other contraband were flown into Scottish prisons in October 2023 using drones.
On Wednesday, a drone thought to be carrying a package of drugs crashed near HMP Edinburgh, with Police Scotland launching an investigation.
Last year, a guard who smuggled cocaine for inmates into HMP Shotts was jailed for more than six years.
Mother-of-two Heather McKenzie had formed a “close relationship” with murderer Zak Malavin and ferried drugs and mobile phones into the prison before she was caught.