US Secretary of Defense Mark Esper on Thursday held talks in Algeria on renewing a strategic alliance as the North African state tries to mediate in war-ravaged Libya and Mali while battling extremists at home.

Esper, the first American defence chief to visit Algiers since 2006, held a lengthy meeting with Algeria's President Abdelmadjid Tebboune, who also holds the post of defence minister, and the chief of staff, General Said Chanegriha as well as external security chief Mohamed Bouzit.

The two sides agreed to "consolidate the foundations of peace and security in the region, within the framework of unity and sovereignty of countries", an Algerian official statement read.

The US embassy said Esper "voiced support for expanding the military relationship and highlighted Algeria's steady leadership in regional security".

The two sides discussed "security throughout North Africa and the Sahel and ways to advance our strategic military and diplomatic partnership", it added.

Ahead of the visit, a senior US military official said Washington hoped "to deepen cooperation with Algeria on key regional security issues such as the threat posed by extremist groups".

US Defence Secretary Mark Esper and his wife Leah are on a three-nation North Africa tour
US Defence Secretary Mark Esper and his wife Leah are on a three-nation North Africa tour AFP / FETHI BELAID

Esper laid a wreath at the country's independence war memorial overlooking Algiers before talks with the president.

The defence chief, on a North Africa tour, arrived in Algiers after talks in neighbouring Tunisia and later travelled on to Morocco.

Esper became the first US defence minister to visit Algeria -- an ally of Russia, which supplies most of its weapons, and China -- since Donald Rumsfeld almost 15 years ago.

But ties between Washington and Algiers have been strengthened by their common aim to counter Islamist militants.

"Algeria is a committed counter-terrorism partner," General Stephen Townsend, head of US Africa Command, said on a recent visit to Algiers.

"Strengthening this relationship is very important to us," Townsend said. "Degrading violent extremist organisations... and enhancing regional stability is a mutual must."

Algerian President Abdelmadjid Tebboune is due to meet US Secretary of Defence Mark Esper on Thursday in Algiers
Algerian President Abdelmadjid Tebboune is due to meet US Secretary of Defence Mark Esper on Thursday in Algiers AFP / RYAD KRAMDI

Algeria is trying to reactivate its role on the regional diplomatic scene, including as a mediator in the conflicts in Mali and Libya.

Jihadist groups in Libya and the wider Sahel region have become an increasing concern since a NATO-backed uprising toppled and killed longtime dictator Moamer Kadhafi in 2011.

Conflict in Libya since then has sucked in multiple nations backing opposing forces, including Turkey and Egypt.

Mali, supported by France and UN peacekeepers, is struggling with an eight-year-old Islamist insurgency that has claimed thousands of lives.

"The Americans want to reposition themselves in the region, which has seen the arrival of new players like Turkey," said Algerian political scientist Mansour Kedidir.

"Algeria has always been considered by the Americans as a 'pivotal state' whose vulnerability can engulf the whole region if it is affected by jihadists."

The US and Algeria have historic ties -- a treaty of friendship was signed in 1795 -- while during Algeria's 1954-1962 war of independence from colonial rulers France, Washington reportedly pressured Paris to negotiate with Algerian nationalists.

"The United States has a strong bilateral security relationship with Algeria," said Michael Shurkin, from the California-based RAND Corporation policy think-tank.

The US relationship is crucial for another reason, Shurkin noted.

"The US role must also be seen in the context of Algeria's reluctance to work with France, which makes the US necessary for France with respect to French hopes for an integrated regional response to jihadism," Shurkin said.

France has 5,100 soldiers deployed across the Sahel as part of its anti-jihadist Operation Barkhane.

Washington is also likely interested in selling weapons to Algeria, which currently receives some 90 percent of its military supplies from Russia.

Just ahead of Esper's visit, army chief Chanegriha met with a top Russian military delegation for discussions on the state of "military cooperation between the two countries", Algeria's defence ministry said.