Endoscopy services will be restarted on the NHS, the Scottish government has announced.
Health services and treatments that had been postponed during the coronavirus pandemic are now gradually being restored.
A £7.8m investment will be used to tackle the backlog of patients waiting to have an endoscopy.
Certain patients will be prioritised for the procedure based on their clinical needs.
An endoscopy involves the insertion of a long thin tube directly into the body to allow doctors to observe an internal organ or tissue in detail.
The government said new technology as well as additional capacity – the NHS Golden Jubilee Hospital, mobile endoscopy units and in the private sector – will help resolve the backlog.
Health Secretary Jeane Freeman said: “There’s no question that stopping endoscopy services for all cases except emergencies was a difficult decision to take. But it was necessary so we could deal with the challenge of Covid-19.
“I’m pleased that as we continue to see positive results in dealing with the virus we can now move to treat the many patients who have been waiting, and we will do that safely and sustainably.
“Patient safety always comes first, so as we steadily re-mobilise our NHS, your experience as a patient will be a bit different, and it will take us longer than before to see people as we maintain our vigilance against the virus with important additional safety measures.”