Burkina Faso, bordering Mali and Niger, has seen regular militant attacks which have left hundreds dead since the start of 2015 when militant violence began to spread across the Sahel region.
Burkina Faso was in mourning on Wednesday after militants killed 35 civilians, almost all of them women, in double attacks in the north in one of the deadliest assaults in nearly five years of violence in the West African country.
Seven soldiers and 80 militants also died in Tuesday's simultaneous attacks on the town of Arbinda and its military base in Soum province, which lasted "several hours" and was of a "rare intensity", the army said.
Burkina Faso, bordering Mali and Niger, has seen regular militants attacks which have left hundreds dead since the start of 2015 when militant violence began to spread across the Sahel region.
"A large group of terrorists simultaneously attacked the military base and the civilian population in Arbinda," the army chief of staff said in a statement.
"This barbaric attack resulted in the deaths of 35 civilian victims, most of them women," President Roch Marc Christian Kabore added on Twitter, praising the "bravery and commitment" of the defence and security forces.
Government spokesman Remis Dandjinou later said 31 of the civilian victims were women, adding around 20 soldiers and six civilians were wounded.
The president has declared 48 hours of national mourning.
There was worldwide condemnation of the attack, as well as expressions of support for Burkina Faso.
In his traditional Christmas message at the Vatican in Rome, Pope Francis denounced attacks on Christians in Africa and prayed for victims of conflict, natural disasters and disease on the world's poorest continent.
The pontiff urged "comfort to those who are persecuted for their religious faith, especially missionaries and members of the faithful who have been kidnapped, and to the victims of attacks by extremist groups, particularly in Burkina Faso, Mali, Niger and Nigeria."
In Brussels, the head of the European Council Charles Michel tweeted: "Inates in Niger yesterday, Arbinda in Burkina Faso today... Martyr towns, victims of a rampant terrorism that threatens us all. The European Union stands by Africa in its battle against terrorism."
Niger's president Mahamadou Issoufou also expressed his "solidarity" and, speaking "in the name of the Nigerien people" offered his "condolences for all civilian and military victims."
The morning raid was carried out by dozens of militants on motorbikes and lasted several hours before armed forces backed by the air force drove the militants back, the army said.
No group immediately claimed responsibility for the attack, but militant violence in Burkina Faso has been blamed on militants linked to both Al Qaeda and Daesh groups.
560,000 internally displaced
Leaders of the G5 Sahel nations held summit talks in Niger earlier this month, calling for closer cooperation and international support in the battle against the threat.
Militant violence has spread across the vast Sahel region, especially in Burkina Faso and Niger, having started when armed militants revolted in northern Mali in 2012.
The Sahel region of Africa lies to the south of the Sahara Desert and stretches across the breadth of the African continent.
There are 4,500 French troops deployed in the region as well as a 13,000-strong UN peacekeeping force in Mali to fight insurgents.
The G5 group is made up of Chad, Burkina Faso, Mali, Mauritania and Niger, whose impoverished armies have the support of French forces as well as the UN in Mali.
In Burkina Faso, more than 700 people have been killed and around 560,000 internally displaced, according to the United Nations.
Attacks have targeted mostly the north and east of the country, though the capital Ouagadougou has been hit three times.
Prior to Tuesday's attack, Burkina security forces said they had killed around a hundred militants in several operations since November.
An ambush on a convoy transporting employees of a Canadian mining company in November killed 37 people.
Attacks have intensified this year as the under-equipped, poorly trained Burkina Faso army struggles to contain the militancy.