A British and an Italian hostage killed on Thursday were murdered by "their Boko Haram captors" and those responsible have been arrested, Nigerian President Goodluck Jonathan said in a statement.
Jonathan "condemned the killing of two kidnapped foreigners -- an Italian and a British citizen -- in Sokoto state Thursday by their Boko Haram captors before they could be rescued by a joint security raid on the kidnappers' hideout," a statement from his office said.
"The president, who particularly commended the cooperation and understanding of the British and Italian governments, 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 events leading up to the shooting of the hostages, his office in Rome said.
But former Italian prime minister Massimo d'Alema, who is now in charge of a parliamentary committee dealing with security issues, criticized the attempted rescue operation, which he said was apparently mounted by British and Nigerian forces without Italy being notified.
The parliamentary committee "will take all measures to ensure full light is made on the case," d'Alema told reporters.
Speaking in London, British Prime Minister David Cameron earlier said he had given the go-ahead for a rescue operation after "credible information" was received about the location of Chris McManus and Franco Lamolinara, who were seized by gunmen in May 2011.
Jonathan's statement marked the first time Islamist group Boko Haram, which has carried out scores of attacks in Nigeria, was officially blamed for the May 2011 kidnapping of the two men in Nigeria's Kebbi state.
Boko Haram has 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.
Diplomats have said some Boko Haram members have sought training abroad, but there has been no 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 Niger, which borders Nigeria to the north, but never in Nigeria itself.
Sokoto state is located in far northwestern Nigeria and neighbours Kebbi.
Residents said a shootout lasting some seven hours occurred Thursday at a building under construction in the Mabera area of the city of Sokoto, capital of Sokoto state.
They 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, near the Niger border, in May 2011. They had been helping build a central bank building in the city.
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 Nigerian 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.
Violence blamed on the group, whose goals remain largely unclear, has claimed more than 1,000 lives since 2009, with more than 300 this year alone, according to figures tallied by AFP and rights groups.
Nigeria's 160 million population is roughly divided between a mainly Muslim north and predominately Christian south.