ALGIERS, Feb 11 (Reuters) - Islamic State said on Tuesday that it was behind Sunday's attack on an Algerian military barracks near the country's border with Mali that killed one soldier.

The militant group sent the bomber in a vehicle rigged with explosives, but a sentry stopped him before he could enter the compound and the blast killed both men, according to a Defence Ministry statement. The group's Algerian leader is a 47-year-old militant known as Abu Walid el-Sahrawi.

"The martyred brother Omar al-Ansari ... entered the base and exploded his car against them," the group said in a statement.

Algeria, in common with other countries in the Sahel and Sahara regions, is growing increasingly concerned about the risk of militant groups taking advantage of the escalating conflict in Libya and chaos in Mali to expand their presence.

In Mali, the government has said it is ready to talk with jihadist groups in the hope of ending an insurgency that has made swathes of the country ungovernable and stoked ethnic violence.

In Libya, chaos in parts of the country since the 2011 revolution has created space for Islamic State, which launched a cross-border attack against a Tunisian town in 2016, but which is now mostly active in Libya's south.

"We need to focus on both Libya and Mali," a former Algerian counter-terrorism officer told Reuters. "This attack could be a preparation for what might come if we don't contain the threats."

Algiers has been discussing how to stem the rising militant threat in the Sahel with Mali in recent days, and has offered it some humanitarian assistance. It shares more than 1,500km of mostly remote, desert border with Mali and Libya.

Sunday's attack was the first in Algeria for several years. In 2013, an Islamist militant group linked to al Qaeda staged an attack on the Tiguentourine gas processing facility in southern Algeria that killed dozens of people, including foreigners.

That was the deadliest spasm of militant violence in Algeria since a 1990s civil war between Islamist groups and the state in which more than 200,000 people died.

Story continues

Algeria is already wrestling with a major political crisis after a year of mass protests that helped oust the veteran president and have continued, with demonstrators now demanding the ruling elite be fully replaced.

The country also faces economic problems, with declining energy sales contributing to a fall in state revenue and planned cuts in public spending this year.

(Reporting By Lamine Chikhi, writing by Angus McDowall; editing by Philippa Fletcher)