A council has been fined £27,000 after an outbreak of Legionnaires' disease left a man fighting for life.
Tendring District Council was investigated by the Health and Safety Executive (HSE) after a "catastrophic failure" at the Lifestyles leisure centre in Walton-on-the-Naze, Essex.
Graham Leach contracted the disease in November 2016 after using the showers, Colchester Magistrates' Court heard.
The council said it had since improved processes for managing legionella risk.
District Judge John Woollard said the council's fine would have been 10 times higher had it not been a public body.
He said: "This was a fairly catastrophic failure on their part to manage council facilities, in particular in the prevention of legionella in their leisure facilities.
"I see from the hospital that treated Mr Leach that he was close to death, had they not treated him in time."
'Fall in standards'
The court was told that after bringing legionella control in-house, those responsible were not properly trained.
Matthew Taylor, prosecuting, told the court that had been the case for nearly 10 years from 2007 and said its legionella controls were "poorly implemented".
Tendring District Council apologised to Mr Leach, who was a regular at the leisure centre.
Chief executive Ian Davidson said: "I would like to reassure the public, and particularly our leisure centre customers, that our leisure centres are safe.
"We deeply regret that standards fell below the high level that we hold ourselves to, and we know which the public expect from us."
Mr Davidson said the fine would impact upon council budgets but it would attempt to mitigate the knock-on effect to the taxpayer.
The symptoms of Legionnaires' disease are similar to the flu, and include a high temperature, muscle pains and headaches.