A Briton and an Italian abducted in Nigeria last year have died in a rescue bid by UK and Nigerian forces, Prime Minister David Cameron has announced.
He said it appeared Chris McManus - from north-west England - and Franco Lamolinara had been "murdered by their captors before they could be rescued".
The BBC's Gordon Corera said UK troops "were first in" and shot a kidnapper but it was too late to save the men.
Gunmen seized the two engineers in Birnin Kebbi city on 12 May 2011.
The city is in north-west Nigeria.
A video was released to news media last year that appeared to show the men blindfolded with their arms behind them. Masked men were standing behind them in the footage.
Mr Cameron said authorities had decided to go ahead with the rescue operation after receiving "credible information about [the men's] location".
"A window of opportunity arose to secure their release. We also had reason to believe that their lives were under imminent and growing danger," he said.
The prime minister said it was "with great regret" that he had to announce that Mr McManus and Mr Lamolinara had lost their lives in the subsequent operation.
The Foreign and Commonwealth Office (FCO) later confirmed the men were killed in Sokoto, Sokoto State, to the north-east of the city they had been taken from.
Mr Cameron offered his condolences to the two men's families. "Both families have endured a terrible ordeal, and this is a devastating moment for all of them," he said.
He thanked the Nigerian authorities and Nigerian President Goodluck Jonathan for all they had done to find Mr McManus and "combat terrorism".
"I also want to pay tribute to all those, including UK personnel, who worked so hard to try to bring Chris home safely," Mr Cameron said. "I am very sorry that this ended so tragically. Terrorism and appalling crimes such as these are a scourge on our world."
Mr Jonathan said that the men's captors had been seized and "would be made to face the full wrath of the law". He described them as being from Boko Haram, a militant Islamist group that has carried out a number of attacks on police, politicians and clerics who oppose it.
An FCO spokeswoman later said the hostage-takers were associated with the group.
BBC security correspondent Gordon Corera said he understood the attack was most likely to have been the work of a splinter cell within Boko Haram, with possible links to al-Qaeda.
Our correspondent said: "I am told British troops were first in. They shot one of the kidnappers but by the time they reached the hostages it was too late."
The BBC's Tomi Oladipo said Nigeria's northern borders are quite porous and any group could have been behind the attack. He said Boko Haram has been carrying out almost daily attacks in the north, which is poor and undeveloped, but that these are the first killings of their kind in the area.
In a statement, Mr Jonathan extended his "heartfelt condolences to the families of the bereaved and the people and government of Britain and Italy".
Mr McManus's family released a statement saying they were "devastated" by his death but thanked those who had worked to try to free him.
"During this ordeal we have relied heavily on the support of our family and friends which has never waned and has enabled us to get through the most difficult of times," they said.
"We are also aware of the many people who were working to try and have Chris returned to our family, and his girlfriend. We would like to thank all of them for their efforts.
"We knew Chris was in an extremely dangerous situation. However we knew that everything that could be done was being done."
The family said their thoughts were also with Mr Lamolinara's loved ones and asked that their privacy be respected.
Italian Prime Minister Mario Monti said said Mr Lamolinara was from the small northern town of Gattinara, in Piedmont, but was understood to have worked in West Africa for a number of years.
He said Italy was only informed about the rescue mission after it had begun.
In a statement, his office said Mr Monti had asked Mr Jonathan to provide "as soon as possible" a "detailed reconstruction of the events that led to the killing of hostages Franco Lamolinara and Christopher McManus".
BBC correspondent Alan Johnston said one MP from the centre-left Democratic Party was now demanding to know why Italy was not involved in the decision to go ahead with the operation.
BBC Africa reporter Haruna Shehu Tangaza visited the house in Sokoto. He said four bodies had been removed from the building.
He said the general view of people in the area was that the hostage takers were not members of Boko Haram or al-Qaeda but kidnappers wanting money.
Mr Lamolinara and Mr McManus had been involved in the construction of the state headquarters for the Central Bank of Nigeria.
They had been working for B Stabilini, an Italian construction firm based in the Nigerian capital, Abuja, when they were kidnapped.
Another Italian employee managed to escape during the kidnapping but a Nigerian neighbour who came to help was shot and wounded.