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 in talks with Algerian prime minister, Abdelmalek Sellal
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.
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."
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.
Suggested For You
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements. Learn more