Two soldiers were lightly wounded in the action and "on the enemy side; 38 terrorists killed," Niger defence ministry spokesman Moustapha Ledru said on state television.
Substantial quantities of weapons and munitions were also seized, Colonel Ledru added.
The joint army operations took place between Monday and Wednesday around the villages of Gueskerou and Toumour in southeastern Niger, he added.
According to villagers and NGO workers in Gueskerou, 30 kilometres from Diffa, Boko Haram elements attacked the town on Wednesday night, without killing anyone.
"The attack nonetheless caused a psychosis in the population" and "the assailants torched houses and stole food and medicines after pillaging shops and a pharmacy," an NGO official told AFP.
Boko Haram's seven-year insurgency has left at least 20,000 people dead in Nigeria and border areas of neighbouring Niger, Chad and Cameroon, and made more than 2.6 million homeless.
Attacks in Niger's Diffa region began in February 2015.
In late July this year a multinational force, drawn from Nigeria, Niger, Chad and Cameroon, was formed to tackle the Islamic insurgents and clear them out of towns and villages.