Soldiers will be deployed in NHS Borders and NHS Lanarkshire from Tuesday, health secretary Humza Yousaf confirmed.
Mr Yousaf said he hoped their support will reduce waiting times, enhance care and provide a better experience for patients in two health boards where staffing is particularly short.
Dr Lewis Morrison, Chair of BMA Scotland, said the move “emphasises the seriousness and scale of the pressures on NHS services and frontline healthcare staff”, and called for short, medium and long-term plans to address staffing issues.
A total of 86 military personnel will be in post initially until November 10, with this date kept under review.
They will join the 114 soldiers who have been working with the Scottish Ambulance Service since September, and the 111 general duties troops who have been helping with Covid testing.
Those in Lanarkshire will include 45 military medics, 12 general duties personnel and three drivers who will be working in acute settings.
In NHS Borders, 14 military medics, two nurses, four general duties troops and a military driver will be brought into acute settings.
Two military medics will oversee operations from the army’s Scotland headquarters at Redford Barracks in Edinburgh.
The support personnel will be from the Royal Navy but the medically qualified staff will be from the army, the Ministry of Defence said.
Health Secretary Humza Yousaf said the measure had been taken due to staffing shortages.
He said: “The NHS is experiencing significant pressure at the moment because of Covid-19 admissions and the backlog in care built up during the pandemic and we are taking a range of steps to introduce additional capacity in order to help with the unprecedented pressures on the health and care system.”
He added: “In the NHS Borders and NHS Lanarkshire areas, staff shortages because of Covid-19 are affecting bed capacity and temporary military assistance has been requested to support the boards at this time.
“With increasing levels of social mixing and close social contact it is expected that this winter Covid-19 will circulate alongside respiratory viruses, such as flu, adding to the winter pressures usually faced by the NHS.
“This military support will allow both boards to support existing staff to reduce waiting times, enhance care and provide a better experience for our patients.”
Dr Lewis Morrison, Chair of BMA Scotland, also warned other areas in Scotland are close to if not already at the same level of pressure as in NHS Borders and Lanarkshire.
He said: “Additional help is clearly welcome but the need to ask personnel from the military to assist emphasises the seriousness and scale of the pressures on NHS services and frontline healthcare staff. It demonstrates that things are on a knife edge in the areas where this is happening - but there are many other places where staff are spread incredibly thinly and close to if not at the same level of pressure.
“We need politicians on all sides to be honest with the public about what the NHS can deliver right now and over this expected long winter. The use of the military can only be a short term measure and it will barely scratch the surface in terms of providing the additional staff so many places need.
"Each passing week and story of a service in crisis underlines the urgent need for a clear workforce plan to address those huge short, medium and long term staffing issues and a plan that focuses firstly and squarely on caring for and retaining the staff we have because recruiting extra people takes time.”
NHS Borders said the soldiers would allow the health board to re-start non-urgent operations, which had been paused because of the pressure on services.
The new resource will also help to reduce waiting times at A&E and bridge the gap before the health board can recruit new staff ahead of winter, said Gareth Clinkscale, Director of Acute Services.
Judith Park, Director of Acute Services at NHS Lanarkshire, also welcomed the support.
“NHS Lanarkshire is experiencing significant pressure at the moment because of Covid admissions and the backlog in care built up during the pandemic and we are taking a range of steps to introduce additional capacity in order to help with the unprecedented pressures on our health and care system,” she said.
"Staff shortages because of Covid-19 are affecting bed capacity and the approval of temporary military assistance on our hospital sites is very welcome over the next few weeks as we begin to see winter illnesses circulate alongside Covid adding to the pressures we face.
“This military support will allow to support our staff and patients and I would like to take this opportunity to thank our staff for their continuing hard work and dedication over this particularly busy time.”
Brigadier Ben Wrench, Commander Joint Military Command Scotland, said: “The Armed Forces in Scotland as always stand ready to support civil society in Scotland and the rest of the UK.
"The ability of trained military healthcare professionals and their support team to deploy at short notice and provide short term support to cover a critical gap shows the utility of the Armed Forces and the strength of the ongoing relationship with partner civilian organisations.”
The move was welcomed by opposition MSPs, but Scottish Conservative Shadow Health Secretary Dr Sandesh Gulhane said action should have been taken sooner.
“This support from our UK Armed Forces is hugely welcome, but Humza Yousaf should have been on top of this situation immediately,” he said.
"We aren’t even into the peak winter period, yet my colleagues on the frontline are already well beyond breaking point.”