Gambia released more than 200 prisoners on Friday, including 31 jailed for treason during multiple plots to overthrow long-ruling President Yahya Jammeh, prison officials said.
Hundreds of cheering and weeping friends and relatives gathered outside the Mile 2 prison in the tiny West African country's capital to greet them.
Those linked to a failed attempt to oust Jammeh in December remain imprisoned although their family members, including the elderly mother of the alleged ringleader, were freed, officials said.
Former inmates, some of whom were jailed for 15 years, took turns to express gratitude for their release, announced by Jammeh in a speech on Wednesday to celebrate 21 years since his accession by military coup.
Three Dutch citizens, a German and an Australian who had been jailed on drug charges were among 49 foreigners released, the officials added.
"I serve the Gambian government for many years and never had any problem but by God's will I entered this mess," former director of the National Intelligence Agency, Lamin Bo Badjie, said. "I want to thank the president for this surprise gesture."
Among those freed were former justice minister Momodou Lamin Jobarteh and former police chief Ensa Badjie, jailed for alleged corruption and drug trafficking respectively.
Amnesty International, one of several rights groups that has expressed concern about growing repression in Gambia, welcomed the release.
"However, we are aware that just a few weeks ago prisoners who were released were rounded up again and taken back to prison," said researcher Sabrina Mahtani. Gambia said it released 85 prisoners during the Muslim holy month of Ramadan.
The government has denied a deterioration in civil liberties and says the re-arrests that Amnesty referred to were due to a mix-up over four names.
The Mile 2 prison has gained notoriety among residents and rights groups for its secrecy. The United Nations Special Rapporteur said the government barred him from visiting the security wing during a visit in November last year.