It had been proposed to withdraw staff from Hirta, St Kilda
Plans to cut jobs at a missile range and its associated sites on the Western Isles have been abandoned, the Scottish Secretary Jim Murphy has said.
The range's command and control centre on South Uist was to close and rocket tests run remotely from South Wales.
Staff were also to be pulled out of the range's tracking station on Hirta, St Kilda, and West Camp on Benbecula was to be downgraded.
Mr Murphy's announcement was met by cheers from staff.
The sites are operated for the Ministry of Defence (MoD) by defence technology contractor QinetiQ.
It had been proposed to cut 125 jobs as part of a wider programme of defence savings aimed at reducing MoD costs by £40m.
Campaigners and politicians have welcomed the announcement.
Mr Murphy made the announcement to staff who had gathered at the South Uist site.
Defence Minister Quentin Davies, who previously met campaigners, was unable to make the announcement himself because of a long standing commitment to visit the US.
In a statement, he said he had been impressed by the arguments for saving the sites.
Later, Mr Murphy told BBC Scotland the facilities were of strategic importance to the UK.
He said: "We have decided after looking at the figures that the jobs will be saved.
"The firing range and control station will remain, these 125 jobs will stay, because ultimately while the MoD may have made some savings, the cost to the islands, the islands' families and the economy would have been too great."
He added: "It is here, it is here to stay."
The Hebrides Range Taskforce said range should now be expanded and made available for the testing of unmanned aerial vehicles - aircraft used to spy and attack targets.
Angus Campbell, leader of Western Isles council Comhairle nan Eilean Siar and taskforce chairman, said the announcement was good news for the islands.
He said: "The taskforce believes the proposals were ill thought out.
"They would have irreparably damaged the UK's defence capability and the economy of a fragile community as well as putting St Kilda, the UK's only Dual World Heritage site, at risk."
National Trust for Scotland, which owns St Kilda, previously expressed concerns that the withdrawal of test range staff from Hirta would seriously harm its ability to manage the remote island archipelago.
A trust spokeswoman said: "We're delighted that the proposal to de-staff St Kilda has been abandoned, along with the plans to reduce staff on Benbecula and the Uists.
"This means that the trust's activities on the island will remain unaffected. St Kilda is still a challenging site to manage due to its remote location, but this is very good news for us indeed."
Highlands and Islands Enterprise (HIE), a member of the taskforce, also welcomed the move not to change the running of missile tests.
Chairman William Roe said: "This decision is testimony to the speed and determination shown by the community and its public agencies in putting together a number of compelling arguments which challenged the narrow perspective offered on current and future use of the range."
The islands' SNP MP Angus MacNeil and MSP Dr Alasdair Allan hailed the decision.
Dr Allan said: "This climb down is a huge relief for the workers and their families, and a tremendous victory for the community campaign to save these jobs."
The taskforce's efforts were applauded by Labour Highlands and Islands MSP Peter Peacock.
He said: "The local task force and community are to be congratulated on their fantastic campaign and Jim Murphy and his Westminster colleagues deserve the utmost credit for doing a great job for the islands."