Two soldiers were killed and several more were wounded when Islamist militants attacked a border security post in northern Benin on Wednesday night, the army said.
The raid in Porga region was the second in Benin this week. Islamist militants attacked an army patrol in the department of Alibori on Tuesday morning, army chief Colonel Fructueux Gbaguidi said in an internal statement on Thursday seen by Reuters.
The army killed one militant in Tuesday's attack and another on Wednesday night, he said. An official statement by the army later confirmed the deaths and attributed the attacks to unidentified armed men.
Militant attacks are rare in Benin, but groups linked to al-Qaida and Islamic State are active in its northern neighbors Burkina Faso and Niger and have made increasing incursions south.
Islamist militant violence has ravaged much of West Africa's Sahel region, and states on the Gulf of Guinea have reinforced security to try to keep it at bay.
"This new test reminds us in blood and pain that the danger on the ground is real," Gbaguidi said in his note to officers.
Benin had not reported an Islamist attack since 2019, when two French tourists were kidnapped in a national park and later taken by the militants into Burkina Faso. They were rescued by the French military.
Neighboring Togo said last month it had repelled an attack near its northern border, which was the first by suspected Islamists in the country.