It was "right to try" and rescue the captured British aid worker Linda Norgrove, David Cameron has said.
Ms Norgrove was fatally wounded as American special forces attempted to free the 36-year-old from her captors in Afghanistan.
Ms Norgrove was kidnapped two weeks ago when she and the two-car convoy carrying her and three colleagues was ambushed in Kunar province - a well-known militant area.
An Afghan intelligence official, who spoke on condition of anonymity, said the rescue team was closing in on the property where Ms Norgrove was being held when her captors threw a grenade into the room where she was kept, killing her.
Allied troops then opened fire, killing all of the militants in the property.
The Prime Minister said: "My thoughts are with Linda's family, who will be devastated by this tragic news. She was doing valuable work for the Afghan people," Mr Cameron said in a statement.
"Decisions on operations to free hostages are always difficult.
"But where a British life is in such danger, and where we and our allies can act, I believe it is right to try."
Foreign secretary William Hague released a statement through the Foreign Office saying: "It is with deep sadness that I must confirm that Linda Norgrove, the British aid worker who had been held hostage in eastern Afghanistan since 26 September, was killed at the hands of her captors in the course of a rescue attempt last night."
Mr Hague said British allies had received information about where Ms Norgrove was being held and decided to act "given the danger she was facing".
However, he said: "Responsibility for this tragic outcome rests squarely with the hostage takers. From the moment they took her, her life was under grave threat. Given who held her, and the danger she was in, we judged that Linda's best chance lay in attempting to rescue her."
During the ambush, local police chased the kidnappers but lost them after a brief firefight.
The three Afghan nationals were released a week ago, but Ms Norgrove continued to be held amid growing concern for her life.
The Scottish national had carried out aid work all around the world and spent many years in Afghanistan working for various groups including the United Nations.
She was based in Jalalabad supervising reconstruction programmes for US government-funded company Development Alternatives Inc (DAI) at the time of her kidnap.
Based in Jalalabad, Ms Norgrove supervised reconstruction programmes in the eastern region of the country.
After the ambush, the Foreign Office requested a media blackout, believing Ms Norgrove would be seen as more valuable to her kidnappers if her name was known to the public.
But hopes had been high on the Isle of Lewis, where the aid worker's parents live, that a lack of news meant progress was being made.
DAI president James Boomgard said Ms Norgrove's murder was "devastating news".
"We are saddened beyond words by the death of a wonderful woman whose sole purpose in Afghanistan was to do good," he said.
Source: news.sky.com