Scottish Health Secretary Nicola Sturgeon has announced to parliament that decisions to close two accident and emergency units will be reversed.
The previous government had endorsed plans to close A&E units at Ayr hospital and Monklands in Lanarkshire.
But Ms Sturgeon said health boards in those areas had failed to give enough weight to concerns from local people.
Former health minister Andy Kerr branded the announcement a con and a "sell-out of gigantic proportions".
NHS Ayrshire and Arran and NHS Lanarkshire have now been instructed to produce revised proposals by the end of the year to allow A&E services to continue.
Those proposals, along with future ones, will also be independently scrutinised.
"I have reversed the decisions because I think that is the right thing for the public and patients in Lanarkshire and in Ayrshire," Ms Sturgeon told MSPs.
"The two boards did not in my view give sufficient weight to the concerns expressed by local people about the planned withdrawal of A&E services.
"And the boards did not consult on options that retained A&E services at all of the hospital sites - so the public had no opportunity to weigh up costs and benefits."
Hospital campaigners sitting in the parliament's public benches cheered as the announcement was made - some held up placards stating "SNP saves A&E".
One of the campaigners, Bob Kiltie, said: "The whole place just erupted when the announcement was made."
Ms Sturgeon, who said she would be operating a presumption against centralisation, stressed that public opinion could not override genuine concerns about the safety of services, but neither could it be ignored.
The A&E at Monklands hospital will be saved
However, she said the government had no plans to rewrite "comprehensively" the strategy for the NHS and agreed it was important to shift the balance of care into communities - a strategy favoured by the previous Scottish Executive.
She said the services in Ayr and Lanarkshire would be retained because of particular local circumstances, including geography and high levels of ill health and deprivation.
NHS Ayrshire and Arran and NHS Lanarkshire said they would be working closely with Ms Sturgeon to ensure the changes she has asked for are implemented.
NHS Lanarkshire chairman Ken Corsar said the health board did not underestimate the challenge of maintaining three A&E departments in the region.
He added: "Following this announcement we will develop a process, which will be led by clinical staff, with the remit of identifying proposals that meet the Cabinet Secretary's commitment."
But Andy Kerr, now Scottish Labour health spokesman, accused Ms Sturgeon of failing to bring detail to accompany the decision.
He claimed she had "abdicated her responsibility to make tough decisions", saying of the announcement: "They will cause months of uncertainty, they will put services at risk, they will shatter the confidence of clinicians, they will cause a flight of specialist skills.
"But most of all, and the evidence is there to support this view, they will put patients' lives at risk."
Scots Tory Ayr MSP John Scott welcomed the announcement, saying of Ms Sturgeon: "I welcome her can-do attitude to making two A&E units work in Ayrshire."
But Scottish Liberal Democrat health spokesman Ross Finnie said he was concerned that the government had made the announcement before the health boards had a chance to bring forward alternative proposals.
"I am disappointed that (Ms Sturgeon) did not take the opportunity to present the evidence she has used to come to this decision to parliament," he added.
Dr Peter Terry, chairman of BMA Scotland, said: "The BMA supports the principle that care should be as local as possible but as specialised as necessary.
"We strongly believe that the principle key factor in any decision is a well staffed service that is high in quality and safe for patients.
"NHS plans based on political expediency in response to local pressures will not improve patient care.
"We therefore welcome the Cabinet Secretary's recognition that local views will be balanced with clinical considerations, sustainability, safety and value for money."