The threat of extremism in North Africa could be "much worse" if the West had not intervened in Libya, William Hague has warned.
The Foreign Secretary told BBC Radio 4's Today programme that the spread of weapons across the region and the likelihood of further terror attacks would have been increased if Colonel Muammar Gaddafi had not been deposed.
His comments came as David Cameron prepared to update MPs on the current situation in Algeria, as officials work to establish the fate of the remaining missing Brits.
Hague told the BBC: "Certainly weapons, Tuareg people coming out of Libya have contributed to this situation that then al Qaida in the Maghreb have been able to take advantage of."
"We were involved, if you recall, in saving lives in Libya. I think, actually, if we had not been doing that, because what we did actually shortened the Libyan conflict, these problems would have been, if anything, even greater.
"If the Libyan conflict had gone on for longer, there would have been an even greater flow of weapons and an even greater opportunity for extremists to take hold in Libya."
He added: "While the Libyan situation may well have contributed to what has happened in Mali, I think the action that the Western world took in Libya, if anything, mitigated that."
Hague said Somalia was a model for Western policy-makers, stressing the progress the country had made towards stability.
"What we do not want in these countries like Mali is that 20 years of failed state that preceded all of that in Somalia," he added.
Three British nationals are now known to have died in the four-day siege of the In Amenas gas field in Algeria, which finally ended on Saturday, and three more are believed to be dead. A UK resident is also thought to have died.
The Algerian authorities warned on Sunday night that the confirmed toll of 23 hostages killed at the facility was set to rise sharply.
The first of the British victims to be officially named was 46-year-old Paul Morgan, reported to be a former Foreign Legion soldier and Gulf War veteran who was in charge of security at the In Amenas plant.
Morgan was described by his mother Marianne, 65, and partner Emma Steele, 36, as a "true gentleman" who died doing the job he loved.
In a statement they said: "Paul was a true gentleman, a family man, he very much loved his partner Emma, his mum, brothers and sister, of whom he was very proud.
"He loved life and lived it to the full. He was a professional man proud to do the job he did and died doing the job he loved.
"We are so proud of him and so proud of what he achieved in his life. We are devastated by Paul's death and he will be truly missed.
"We would like to thank the Family Support officers who are helping us through this difficult time."
Others were reported to be Scot Kenneth Whiteside, a 59-year-old from Glenrothes, Fife, who lived in Johannesburg with his wife and two daughters, and Garry Barlow, 49, a married father of two from Liverpool who was a system supervisor for BP at the In Amenas plant.
Carlos Estrada, a Colombian executive for BP who lived in Chelsea, west London, is also reported to have died.
Bomb squads searching for booby-trap devices left by the Islamist militants discovered 25 bodies, some so badly disfigured they could not be identified.
Thirty-two terrorists also died and there were reports last night that five others had been captured alive.
The veteran jihadist Mokhtar Belmokhtar sent a video to a Mauritanian-based news website in which he claimed one of his cells, known as "Those Who Sign In Blood", was responsible for the attack.
In the video - which was said to have been recorded while the siege was still going on and was not posted on the Sahara Media website - he offered to negotiate with Algeria and the West if they halted the bombing of Muslims in Mali.
Hague has previously branded the militants "cold-blooded murderers" and said reports they had "executed" seven of their hostages before the final battle could well be true.