Burkina Faso's president has declared three days of national mourning from Thursday after suspected jihadists killed 47 people, including 30 civilians, in the latest attack in the north of the country.
The assault on Wednesday near the northern town of Gorgadji left 14 soldiers and three militia volunteers dead, as well as the 30 civilians, the communications ministry said.
The soldiers and militia had been "guarding civilians setting off for Arbinda," another town in northern Burkina.
In an ensuing gunbattle, security forces killed 58 "terrorists" and put the rest to flight, according to the government. Nineteen people were also wounded, it said.
Rescue and relief operations are continuing.
The area is in the notorious "three-border" zone where Burkina Faso meets Mali and Niger, a focus of the jihadist violence in the wider Sahel region of west Africa.
It was the third major attack on Burkinabe soldiers in the past two weeks. The attack on 4 August, near the Niger border, killed 30 people, including 11 civilians.
Burkina Faso's deadly summer of violence
President Roch Marc Christian Kabore declared three days of national mourning from Thursday for the victims of the latest attack, according to an official decree.
Burkina Faso has since 2015 been battling increasingly frequent and deadly attacks by jihadist groups affiliated with the Islamic State group and Al-Qaeda.
In early June, gunmen killed at least 132 people, including children, in the northeast village of Solhan, marking Burkina's deadliest attack in the history of the insurgency.
Raids and ambushes have been concentrated in the north and east close to the borders with Mali and Niger, both of which have also faced deadly violence by jihadists.
These attacks along with inter-communal violence have left more than 1,400 people dead and forced 1.3 million to flee their homes, according to official estimates.