Seven soldiers were killed in combat while five others died in an accident while driving to reinforce the unit that had come under attack on Thursday morning, the West African nation's defence ministry said in a statement on Friday.
The attack took place about 190km from the capital Niamey in Kandadji, near the tri-border zone of Mali, Burkina Faso and Niger that has been the epicentre of Islamist insurgencies in the Sahel region in the last few years.
Earlier on Thursday, three sources including a senior military officer, who requested anonymity because they are not authorised to speak to the media, told Reuters that at least ten soldiers were killed.
Neither the sources nor the defence ministry say which group was responsible. Local affiliates of al Qaeda and Islamic State are active in the region and wage frequent attacks on soldiers and civilians.
The defence ministry statement said around a hundred insurgents were killed and their motorbikes and arms were destroyed. It gave no further details.
Two security sources said the army responded to the attack with ground troops as well as helicopters, one of which was hit but was able to return to its base.
Niger is run by a military junta that seized power in a coup in July, partly out of discontent at the worsening security situation. Neighbouring Mali and Burkina Faso have each had two coups in the last three years.