An outbreak of Legionnaires' disease in which three people died has been declared over by health officials.
The move follows a review by the incident management team, chaired by NHS Lothian.
The outbreak in Edinburgh, which came to light at the end of May, is thought to have centred on a cluster of cooling towers in the south west of the city.
To date, the total number of confirmed and suspected cases is 101.
It appears that the action taken at the start of the outbreak was effective, health chiefs said.
Nicola Sturgeon, the Scottish Health Secretary, said it is good news that the outbreak has been declared over, although some patients still remain very ill.
Dr Alison McCallum, director of public health and health policy at NHS Lothian, said: "As we have seen over the last week, we can expect further cases who have been ill for some time to continue to come forward, and our increased surveillance will continue.
"However, all the evidence is suggesting that the action taken when the outbreak was first identified was effective and all cases fall within the expected incubation period. So the decision has been made to declare the outbreak over."
Experts are still investigating the exact source of the outbreak, testing and analysing environmental samples taken from potential sources. But officials believe they may never be able to pinpoint the source conclusively.
All of the 101 cases in the outbreak, during which three men died, have links to the south west of Edinburgh.
Lothian and Borders Police and the Health and Safety Executive (HSE) are jointly investigating the circumstances of the deaths, under the direction of the Crown Office.
Research is also being carried out "to better understand the full extent of the outbreak", officials said.
A report into what happened, including recommendations for the prevention and control of future outbreaks, is being produced.
Dr McCallum said: "Laboratory work is ongoing to try and identify the source conclusively but, as we have said from the start, it may not be possible to do so. There is also more work to be done to gain a better understanding of the scale of the outbreak and how to manage outbreaks in the future.
"We hope that people who are approached to participate in these studies will come forward and help us with this significant piece of research."
Currently, 53 cases of Legionnaires' disease have been confirmed and 48 are suspected.
Of those people being treated in hospital, two patients are in intensive care and four are on general wards. A total of 20 people are being treated in the community and 61 have been discharged from hospital. Ten people are being treated outside the NHS Lothian area.
Ms Sturgeon said: "It is good news that the outbreak has been declared over and, as we have already seen, the number of new cases has been dropping off over recent weeks.
"We have worked closely with NHS Lothian to ensure the outbreak was well managed, and I would like to pay tribute to NHS staff who have coped extremely well with this situation.
"However, we have to remember that there are some patients who remain extremely ill, and NHS staff are maintaining high-quality care for those patients.
"The Health and Safety Executive and Edinburgh City Council are continuing their investigations into the source of the outbreak."
Legionella bacteria are commonly found in sources of water such as rivers and lakes. They can end up in artificial water supplies such as air conditioning systems, water services and cooling towers.
Legionnaires' disease is contracted by breathing in small droplets of contaminated water. Symptoms are mild headaches, muscle pain, fever, a persistent cough, and sometimes vomiting and diarrhoea, and can begin at any time between two and 14 days after exposure to the bacteria.
About half of those who contract the disease will also experience changes to their mental state, such as confusion. It is not contagious and cannot be spread directly from person to person.