A Niamey court on Monday scrapped a nine-month jail sentence handed to Abdoulaye Seydou, head of a leading activist group which supports the ruling military, his entourage said.
Members of Niger's presidential guard seized power in a coup late last month.
Seydou, head of the M62 group, had been behind bars for seven months in a case involving an army air strike on suspected jihadists in the south of the country.
"The Niamey Court of Appeal has cancelled the decision of the High Court... which had sentenced our comrade Abdoulaye Seydou to nine months in prison", said M62 secretary general Sanoussi Mahaman.
"We have always said that Abdoulaye Seydou's detention is an arbitrary decision... orchestrated from start to finish".
The M62 movement, set up a year ago, is a coalition of around 10 groups and NGOs opposed to the presence of French military forces in Niger.
In recent weeks, it has led calls for rallies to support officers who on July 26 toppled the country's elected president, Mohamed Bazoum.
Seydou was taken into custody in January and sentenced in April.
His group had accused the defence and security forces of massacring civilians in helicopter raids on an illegal gold mine last October, launched on the grounds that the alleged killers of two police officers had holed up there.
The government has acknowledged air strikes were carried out after two police were killed at Tamou, near the border with Burkina Faso.
It said seven people were killed and 24 wounded in the raids but the political opposition and civic groups say the death toll was much higher.