David Cameron arrived in Algeria on Wednesday pledging closer security co-operation in the wake of the hostage crisis that claimed the lives of six Britons.
The prime minister said his aim was to help the country "help itself" amid a growing threat from al Qaida-linked terrorists in the region.
David Cameron is to discuss Algeria's security situation with prime minister Abdelmalek Sellal
Speaking to journalists on the flight to Africa, Mr Cameron said: "The In Amenas attack and the situation in Mali reminds us of the importance of partnership between Britain and countries in the region."
Mr Cameron is to hold talks with counterpart Abdelmalek Sellal and pay his respects to victims of the hostage crisis during his visit - the first by a UK prime minister to Algeria in 50 years.
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.
In his discussions with Mr Sellal and president Abdelaziz Bouteflika in Algiers, Mr Cameron is expected to stress the need for a "tough, patient and intelligent response" to extremism in the region.
Defence secretary Philip Hammond was yesterday forced to deny "mission creep" in the intervention to bolster the government in Mali as he boosted the UK's role.
Up to 240 troops could be deployed to train the Malian military and prepare soldiers from other African countries, while another 90 personnel could provide air support.
A roll-on, roll-off ferry has also been offered to transport French equipment to Africa.
The prime minister laid a wreath at Martyrs Monument
Mr Cameron paid his respects at the imposing Martyrs Monument overlooking the Bay of Algiers.
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.
Speaking to reporters afterwards, the prime minister said: "First of all I am here in the wake of that terrible terrorist attack in In Amenas in which six British citizens and one British resident lost their life, a reminder that what happens in other countries affects us at home.
"What I want to do is work with the Algerian government and with other government in the region to make sure we do everything we can do to combat terrorism in a way that is both tough and intelligent, and uses everything we have at our disposal, which will make them safer, make us safer, make the world safer."
Mr Cameron denied that he was getting into another Iraq or Afghanistan-style campaign.
"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."
Mr Cameron also met staff at the British embassy in Algiers to thank them for their work on the hostage crisis.
Also on HuffPost UK: