A Briton and an Italian held hostage in Nigeria were killed by their captors on Thursday as a joint British-Nigerian rescue mission stormed a compound to try to free the men, witnesses and security officials said.

British Prime Minister David Cameron said he had authorised Britain's involvement in the rescue attempt after being told the men's lives were in imminent and growing danger.

Briton Chris McManus and Italian Franco Lamolinara were working for a construction company when they were seized in May from their accommodation in Kebbi state, near Nigeria's northwestern borders with Niger and Benin.

A witness told Reuters security forces tried to force their way into a compound in Sokoto, northwest Nigeria.

The security agencies tried to break into the house but there was resistance. The people inside the house were shooting at them and they returned fire. They exchanged fire for some time, said Mahmoud Abubakar, who lives on the same street.

I saw a military truck come out of the compound with two bodies on it. I didn't see their colour, because they were covered with leaves, he added.

The captors were a faction of militant Islamist sect Boko Haram that had made links with al Qaeda's north African wing, a senior official at Nigeria's State Security Service said.

The hostage-takers shot the hostages before they (the rescue team) even entered the compound. All the terrorists have been killed as well, he said. We arrested some suspects (in the kidnapping) a few days before who led us to them.

Security officials say Boko Haram has received some training, weapons and bomb-making technology from al Qaeda in the Islamic Magreb, which operates in neighbouring Niger and Chad. The militant group is fighting to impose Islamic Sharia law in a country split between Christians and Muslims.

The hostages had been shown in a short video that emerged in August saying they were being held by al Qaeda, although this could not be independently verified at the time. It was widely assumed that they had been smuggled over the border and sold to an al Qaeda faction in Niger.

The video showed the two men blindfolded and on their knees, while three armed men stood behind them, their faces hidden.

UK SPECIAL FORCES

Nigeria's President Goodluck Jonathan condemned the killings which he blamed on Boko Haram and promised the families of the two men that the kidnappers who have all been arrested, would be made to face the full wrath of the law.

British special forces were involved in the rescue, UK media reports said.

We are still awaiting confirmation of the details, but the early indications are clear that both men were murdered by their captors, before they could be rescued, Cameron said in London.

Italian lawmakers said Britain had only told them about the rescue attempt after it began and demanded an investigation into why they were kept in the dark.

Prime Minister Mario Monti had called Nigerian President Jonathan and asked for a complete reconstruction of the operation as soon as possible, according to a government statement.

It will be necessary to rigorously verify the circumstances that led the British authorities to decide to conduct a military operation without beforehand informing the Italian authorities even though one of our citizens was involved, Massimo D'Alema, head of a parliamentary committee that oversees the secret services and a former prime minister, said in a statement.

Relatives of McManus said they were devastated by his death. We knew Chris was in an extremely dangerous situation. However we knew that everything that could be done was being done, his family said in a joint statement.

Lamolinara, an engineer, had been in Nigeria for a decade before being kidnapped, and was helping to construct a building for the central bank, according to Italy's Ansa news agency.

(Additional reporting by Tim Cocks in Lagos, Steve Scherer in Rome, and Camillus Eboh and Felix Onuah in Abuja; Writing by Tim Castle and Peter Griffiths; Editing by Andrew Heavens and Jon Boyle)