Two policemen were killed late Tuesday when gunmen attacked a police station on the northern edge of the Niger capital Niamey, a security official said.
It is the closest attack to the city yet in a long-running insurgency by suspected jihadists.
“The toll is two dead and four wounded, two of them serious,” the security source said Wednesday.
“We heard gunfire coming from the station at 11:00 pm (2200 GMT),” a witness told AFP, speaking on condition of anonymity.
The police station is at the northern entrance to the city, on the highway from Ouallam, about 100 kilometres (60 miles) away.
Police investigators were on the scene on Wednesday morning, an AFP reporter saw.
Niger, a large, impoverished state in the heart of the fragile Sahel region, is grappling with attacks by jihadist groups in the west of the country, and raids by Boko Haram Islamists in the south, near the border with Nigeria.
Eighty-eight civilians were killed by Boko Haram in March alone, and more than 18,000 villagers forced to flee their homes, according to the United Nations.
On June 8, a US military vehicle was hit by an improvised explosive device as it entered a firing range near Ouallam for a joint training exercise.
Niger hosts an estimated 800 US troops, the largest American deployment in Africa.
The scale of the US presence came to light in October 2018, when four US and five Nigerien troops were killed in an ambush by fighters affiliated to the so-called Islamic State group.
Security is tight in Niamey, with high-profile deployment of the military and police and checkpoints on the highways into town.
The city is due to host a summit of the African Union (AU) on July 7 and 8.
Also gunmen killed a soldier and three other people in an attack in north-central Nigeria on Tuesday, state police said.
State Commissioner of Police, Isaac Akinmoyete, said the attack took place in the early hours of Tuesday in the village of Tumburok, about 30 kilometers (20 miles) south of Jos, the capital of Plateau State.
Legislator Timothy Danton confirmed the incident in parliament, but gave the toll as five dead.
According to Akinmoyete, the soldier was shot while exchanging fire with the unknown attackers.
“Three corpses were found and of course some houses were burnt. Many houses were burnt, probably 30 or 40,” said Akinmoyete, adding that an investigation was underway to identify the attackers.
Violence between farmers and nomadic herders is on the rise in Nigeria over access to fertile land and water, which is becoming scarce in the face of drought and rapid population growth.
Plateau State is one of the hotspots for the deadly violence.