Nine other soldiers were critically injured in the Diffa region of the country, the Ministry of Defense said.
Hundreds of Boko Haram militants have stormed a military base in southern Niger, killing 16 soldiers and wounding nine others, the security ministry said.
At least 50 rebels from the group have been killed in fighting in the Diffa region of West Africa and more weapons have been recovered, the ministry said in a statement on Wednesday.
Boko Haram triggered a riot in northeastern Nigeria in 2009, but violence has spread to Chad, Niger and Cameroon in the Lake Chad Basin.
The attack on Tuesday targeted the town of Baroua, where thousands of civilians had recently returned from exile in the aftermath of the 2015 genocide.
More than 6,000 people returned to Baroua at the end of June under a program to encourage about 26,000 people in the region to leave safe villages or UN camps and return home.
Officials said they had set up security to rescue the repatriated people.
On Facebook, a local group called Jeunesse Diffa (Diffa Youth), which also reported security concerns in southeastern Niger, said that “an insurgency had been launched”.
The world’s poorest country with the UN’s Human Development Index (HDI), Niger is facing terrorists on two frontiers.
In the southeastern part of the country near Lake Chad, which is at the heart of the conflict, Boko Haram of Nigeria and its Islamic State, the West African Province (ISWAP) are fighting.
The Diffa region is home to about 300,000 Nigerian refugees and displaced Nigerians.
Western Niger, meanwhile, is battling bloody cross-border threats from militias living in neighboring Mali, including Islamic State militants in the Greater Sahara (ISGS).