A British and an Italian hostage kidnapped in Nigeria nearly a year ago were killed on Thursday as a rescue operation sought to save them, and Nigeria said their Islamist extremist murderers were arrested.

The killing of the two men kidnapped in May 2011 brought a shocking end to their saga and left many unanswered questions after British Prime Minister David Cameron announced their deaths and took responsibility for authorising a rescue.

They were killed in far northwestern Nigeria, Nigeria's president said, and residents reported an hours-long shootout in an area of the city of Sokoto at a building under construction, though authorities had not confirmed details.

British media on Friday reported that the mission was led by elite British special forces, citing unnamed government sources.

Cameron said he had given the go-ahead for a rescue after "credible information" was received about the location of Chris McManus and Franco Lamolinara.

He said the Nigerian authorities, with British support, had launched the attempt to rescue the men after "a window of opportunity arose to secure their release".

"Preparations were made to mount an operation to attempt to rescue Chris and Franco. Together with the Nigerian government, today I authorised it to go ahead, with UK support," Cameron said.

"It is with great regret that I have to say that both Chris and Franco have lost their lives.

"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."

Nigerian President Goodluck Jonathan blamed their deaths on Islamist group Boko Haram in a statement and said the killers had been arrested.

Boko Haram, blamed for scores of attacks in Nigeria, had not been previously known to carry out kidnappings. There has been intense speculation over whether the group has formed ties with Al-Qaeda's north African branch.

In a statement from his office, Jonathan condemned the killing "by their Boko Haram captors before they could be rescued by a joint security raid on the kidnappers' hideout".

"The president ... assured that the perpetrators of the murderous act, who have all been arrested, would be made to face the full wrath of the law," the statement added.

Italian Prime Minister Mario Monti phoned Jonathan to ask him to provide "a detailed reconstruction" of the events, his office in Rome said.

But former Italian prime minister Massimo d'Alema, now in charge of a parliamentary committee dealing with security issues, criticised the attempted rescue operation, which he said was apparently mounted without Italy being notified.

Cameron said the two hostages had been held by "terrorists" who had made "very clear threats to take their lives", and the captives had been in "imminent and growing danger".

British newspapers reported that around a dozen members of the elite Special Boat Service (SBS) had been helicoptered in to rescue the hostages.

AFP received a video showing McManus and Lamolinara in August. In the footage, both men said their kidnappers were from Al-Qaeda.

In a second video received by a Mauritanian news agency and seen by AFP in December, masked gunmen threatened to execute McManus if their demands were not met.

McManus's family said in a statement they were "devastated".

"We knew Chris was in an extremely dangerous situation. However we knew that everything that could be done was being done," they said.

Diplomats have said some Boko Haram members have sought training abroad, but there had not been evidence of operational links with foreign groups.

Al-Qaeda's north African branch, known as Al-Qaeda in the Islamic Maghreb, has in recent years claimed kidnappings of foreign workers in countries including Niger, which borders Nigeria to the north, but never in Nigeria.

Sokoto state is located in far northwestern Nigeria and neighbours Kebbi. Both states border Niger.

Local residents reported that at least two people believed to be among the kidnappers were killed, but authorities did not confirm the report.

The two hostages were kidnapped by heavily armed men who stormed their apartment in the city of Birnin Kebbi in May 2011. They had been helping build a central bank building in the city and worked for construction firm Stabilini Visinoni.

While scores of foreigners have been kidnapped for ransom in Nigeria's oil-producing Niger Delta region, abductions in the mainly Muslim north have been relatively rare.

A German citizen was kidnapped in January on the outskirts of the northern city of Kano. That kidnapping came in the wake of January 20 coordinated bombings and shootings in Kano claimed by Boko Haram which left 185 people dead.

Boko Haram has been blamed for increasingly deadly and sophisticated attacks in Nigeria, Africa's most populous nation and largest oil producer.

It claimed responsibility for the August suicide bombing of UN headquarters in the capital Abuja which killed at least 25 people, while its deadliest attack yet was the January 20 siege of Kano.

Nigeria's 160 million population is roughly divided between a mainly Muslim north and predominately Christian south.