Britain and Algeria could work together to respond to any future hostage crisis, under a deal unveiled by David Cameron.

The prime minister said a new security partnership could see greater intelligence-sharing to tackle al Qaida-linked extremism and joint planning for major incidents.

david cameron algeria

David Cameron in talks with Algerian prime minister, Abdelmalek Sellal

The plans emerged as Mr Cameron became the first UK premier to visit the North African country for 50 years when he arrived on Wednesday.

In a further sign of the increased importance being attached to the relationship, MI6 chief Sir John Sawers and National Security Adviser Sir Kim Darroch have also joined the trip.

At a press conference following talks with Algerian counterpart Abdelmalek Sellal n Wednesday evening, Mr Cameron reiterated the importance of a "tough and intelligent" response to the growing threat from terrorists in the region.

"Both Britain and Algeria are countries that have suffered from terrorism and we understand each other's suffering," he said.

"What we have agreed is a strengthened partnership that looks at how we combat terrorism and how we improve security of this region.

"This should be about sharing our perspectives, about the risks and dangers that there are, but also sharing expertise."

The countries are proposing to boost co-operation on issues such as border and aviation security, and preventing the spread of extremist ideology.

david cameron algeria

The prime minister met the Algerian president, Abdelaziz Bouteflika,at the Presidential Palace in Algiers

Britain has also invited Algeria to take part in a joint contingency planning exercise to share experiences in crisis response.

Mr Cameron defended the decision to boost Britain's contribution to the intervention against rebels in neighbouring Mali.

He denied that the UK - which is now providing up to 330 military personnel for training and air support - was at risk of getting into another Iraq or Afghanistan-style campaign.

Britain had "learned the lessons of the past", he said: "These problems are not dealable with through security measures alone."

Speaking to reporters earlier, Mr Cameron said: "We don't look at this region of the world and think that the answer is purely a military one," he said.

"It is not. What is required in countries like Mali, just as countries like Somalia on the other side of Africa, is that combination of tough approach on security, aid, politics, settling grievances and problems."

Asked to explain to the public why the UK should get involved at all, Mr Cameron replied: "Britain is a very open, international, networked country.

"There are British citizens working all over the world. Britain's posture in the world therefore should reach out, to have partners, to try and ensure the safety of British people both back at home in the UK but also around the world too."

david cameron algeria

The prime minister laid a wreath at Martyrs Monument

Some 37 foreigners, at least 10 Algerians and dozens of terrorists died in the attack on the In Amenas gas plant, which is jointly operated by BP, earlier this month.

The Algerian government took the controversial decision to storm the site in the Sahara desert, with Mr Cameron and other world leaders protesting about not being notified in advance. However, senior government sources insist relations between the governments were not damaged by the events.

Mr Cameron paid his respects at the imposing Martyrs Monument overlooking the Bay of Algiers this afternoon.

After laying a wreath at the memorial, originally built to mark the country's war for independence from France between 1954 and 1962, he stood with his head bowed for more than a minute.

The Prime Minister also met staff at the British Embassy in Algiers to thank them for their work during the hostage crisis.

Loading Slideshow...
  • An unidentified rescued hostage speaks to the media in a hospital Ain Amenas, Algeria, in this image taken from television Friday Jan. 18, 2013. Algeria’s state news service says nearly 100 out of 132 foreign hostages have been freed from a gas plant where Islamist militants had held them captive for three days. The APS news agency report was an unexpected indication of both more hostages than had previously been reported and a potentially breakthrough development in what has been a bloody siege. (AP Photo/Canal Algerie via Assiaciated Press TV) ** TV OUT ALGERIA OUT **

  • Unidentified rescued hostages pose for the media in Ain Amenas, Algeria, in this image taken from television Friday Jan. 18, 2013. Algeria’s state news service says nearly 100 out of 132 foreign hostages have been freed from a gas plant where Islamist militants had held them captive for three days. The APS news agency report was an unexpected indication of both more hostages than had previously been reported and a potentially breakthrough development in what has been a bloody siege. (AP Photo/Canal Algerie via Associated Press TV) ** TV OUT ALGERIA OUT **

  • Algerian special police unit officers secure the hospital in Ain Amenas, Algeria, Friday, Jan. 18, 2013, two days after the start of the terrorist attack at a gas plant. The hostage crisis in the remote desert of Algeria is not over, Britain said Friday, after an Algerian raid on the gas plant to wipe out Islamist militants and free their captives from at least 10 countries unleashed bloody chaos. (AP Photo/Anis Belghoul)

  • An unidentified rescued hostage receives treatment in a hospital in Ain Amenas, Algeria, in this image taken from television Friday Jan. 18, 2013. Algeria’s state news service says nearly 100 out of 132 foreign hostages have been freed from a gas plant where Islamist militants had held them captive for three days. The APS news agency report was an unexpected indication of both more hostages than had previously been reported and a potentially breakthrough development in what has been a bloody siege. (AP Photo/Canal Algerie via Associated Press TV) ** TV OUT ALGERIA OUT **

  • An unidentified rescued hostage speaks to the media in a hospital in Ain Amenas, Algeria, in this image taken from television Friday Jan. 18, 2013. Algeria’s state news service says nearly 100 out of 132 foreign hostages have been freed from a gas plant where Islamist militants had held them captive for three days. The APS news agency report was an unexpected indication of both more hostages than had previously been reported and a potentially breakthrough development in what has been a bloody siege. (AP Photo/Canal Algerie via Associated Press TV) ** TV OUT ALGERIA OUT **

  • This image from video provided by the SITE Intel Group made available Thursday Jan. 17, 2013, purports to show militant militia leader Moktar Belmoktar. Algerian officials scrambled Thursday Jan. 17, 2013 for a way to end an armed standoff deep in the Sahara desert with Islamic militants who have taken dozens of foreigners hostage, turning to tribal Algerian Tuareg leaders for talks and contemplating an international force. The group claiming responsibility — called Katibat Moulathamine or the Masked Brigade — says it has captured 41 foreigners, including seven Americans, in the surprise attack Wednesday on the Ain Amenas gas plant. Algerian Interior Minister Daho Ould Kabila said the roughly 20 well armed gunmen were from Algeria itself, operating under orders from Moktar Belmoktar, al-Qaida's strongman in the Sahara. (AP Photo/SITE Intel Group) THE ASSOCIATED PRESS HAS NO WAY OF INDEPENDENTLY VERIFYING THE CONTENT, LOCATION OR DATE OF THIS PICTURE. MANDATORY CREDIT: SITE Intel Group

  • This April 19, 2005 photo released by Statoil via NTB scanpix, shows the Ain Amenas gas field in Algeria, where Islamist militants raided and took hostages Wednesday Jan. 16, 2013. As Algerian army helicopters clattered overhead deep in the Sahara desert, Islamist militants hunkered down for the night in the natural gas complex they had assaulted Wednesday morning, killing two people and taking dozens of foreigners hostage in what could be the first spillover from France's intervention in Mali. (AP Photo/Kjetil Alsvik, Statoil via NTB scanpix) NORWAY OUT

  • This April 19, 2005 photo released by Statoil via NTB scanpix, shows the Ain Amenas gas field in Algeria, where Islamist militants raided and took hostages Wednesday Jan. 16, 2013. As Algerian army helicopters clattered overhead deep in the Sahara desert, Islamist militants hunkered down for the night in the natural gas complex they had assaulted Wednesday morning, killing two people and taking dozens of foreigners hostage in what could be the first spillover from France's intervention in Mali. (AP Photo/Kjetil Alsvik, Statoil via NTB scanpix) NORWAY OUT

  • JGC Corporation, or Nikki Manager of public relations Takeshi Endo, foreground, answers reporters' questions following Wednesday's attack at a natural gas complex in Algeria which involves the company's workers, at its headquarters in Yokohama, near Tokyo Thursday, Jan. 17, 2013. A militant group that claimed responsibility said 41 foreigners were being held after the assault on one of oil-rich Algeria's energy facilities. Two foreigners were killed. (AP Photo/Kyodo News) JAPAN OUT, MANDATORY CREDIT, NO LICENSING IN CHINA, HONG KONG, JAPAN, SOUTH KOREA AND FRANCE

  • Helge Lund

    Statoil Chief Executive Helge Lund answers questions about the situation in the gas field, jointly operated by BP, the Norwegian energy company Statoil and the Algerian state oil company Sonatrachfield along with Japanese company JGC Corp., in Ain Amenas in Algeria during a press briefing in Stavanger, Norway, Thursday, Jan. 17, 2013. In a desert standoff deep in the Sahara, the Algerian army ringed the natural gas complex where Islamist militants hunkered down with dozens of hostages Wednesday night after a rare attack that appeared to be the first violent shock wave from the French intervention in Mali. (AP Photo/NTB Scanpix, Kent Skibstad) NORWAY OUT

  • Helge Lund

    Statoil Chief Executive Helge Lund answers questions about the situation in the gas field, jointly operated by BP, the Norwegian energy company Statoil and the Algerian state oil company Sonatrachfield along with Japanese company JGC Corp., in Ain Amenas in Algeria during a press briefing in Stavanger, Norway, Thursday, Jan. 17, 2013. In a desert standoff deep in the Sahara, the Algerian army ringed the natural gas complex where Islamist militants hunkered down with dozens of hostages Wednesday night after a rare attack that appeared to be the first violent shock wave from the French intervention in Mali. (AP Photo/NTB Scanpix, Kent Skibstad) NORWAY OUT

  • STATOIL

    Statoil spokesman Ole Anders Skauby, centre right, talks to TV reporters outside Scandic Bergen Airport hotel where a drop-in center is established for relatives of hostages involved in the situation in Algeria. Militants are holding a number of foreigners hostages in the Sahara desert in revenge for Algeria's support of French efforts to remove Islamists from control of neighboring northern Mali. (AP Photo / Hakon Mosvold Larsen / NTB scanpix) NORWAY OUT

  • An unidentified rescued hostage receives treatment in a hospital Ain Amenas, Algeria, in this image taken from television Friday Jan. 18, 2013. Algeria’s state news service says nearly 100 out of 132 foreign hostages have been freed from a gas plant where Islamist militants had held them captive for three days. The APS news agency report was an unexpected indication of both more hostages than had previously been reported and a potentially breakthrough development in what has been a bloody siege. (AP Photo/Canal Algerie via Assiaciated Press TV) ** TV OUT ALGERIA OUT **

  • Residents of Ain Amenas, Algeria, gather outside the hospital trying to get information concerning relatives wounded during the terrorist attack at the gas plant, Friday, Jan. 18, 2013. The hostage crisis in the remote desert of Algeria is not over, Britain said Friday, after an Algerian raid on the gas plant to wipe out Islamist militants and free their captives from at least 10 countries unleashed bloody chaos. (AP Photo/Anis Belghoul)

  • Screen shot 2013-01-18 at 14

  • Screen shot 2013-01-18 at 14

  • Screen shot 2013-01-18 at 14