Ousainou Darboe, United Democratic party leader, among 19 people released from prison after vote that unseated Yahya Jammeh after 22 years in power

The leader of the Gambia’s main opposition party has been released on bail along with 18 other political prisoners following an election that unseated one of Africa’s most autocratic leaders after 22 years of rule.

A courtroom packed with supporters cheered and stood to sing the national anthem as Ousainou Darboe, the leader of the United Democratic party, was allowed to go home after eight months in Banjul’s notorious Mile Two prison.

The Gambia’s poll shock offers rare hope on the continent | Ruth Maclean Read more

On his way into court Darboe, looking much thinner than when he was imprisoned in April, said he felt “great”, adding that he would forgive president Yahya Jammeh, who on Friday conceded the election to Adama Barrow, a former Argos security guard and estate agent who took over Darboe’s party when the latter was jailed.

“Nelson Mandela has been a role model to me,” a smiling Darboe told the Guardian. He said he had done a lot of meditation in jail and that it helped him forgive Jammeh for what he had done to him.

“It’s a new Gambia,” Darboe said. “I congratulate President Jammeh for accepting defeat. That is acting with maturity. I have respect for him. I would never address him as a crazy man and I never would address him as an evil man.”

Under Jammeh’s tenure, many opposition members, journalists and activists have been jailed, tortured and arrested. Some have died, including Solo Sandeng, whose death triggered the protests in which Darboe and the others were arrested.

The UDP is the biggest party in the new coalition that is due to take over from Jammeh in January, and Darboe will almost certainly have one of the top jobs in government.

The prisoners, who had been led into court in handcuffs by riot police, were mostly old men dressed in simple tunics. They had all been beaten when they were arrested for protesting peacefully in April; one lost the sight in his eye.

'Fear has faded': Gambian election could finally end dictator's grip on power Read more

Police in flak jackets and black gloves stood by them, as riot police surrounded the court of appeal, armed with guns and grenades. Outside the court, the streets were filled with cheering Gambians who left work to welcome Darboe.

Darboe’s wife Maya rushed towards him when he entered the courtroom and hugged him, in tears. Nafi, his daughter, said: “It’s like a dream. It’s surreal that this whole thing is over.”

Jammeh is thought to still be in the Gambia, though he has not appeared publicly since accepting defeat in a televised phone call with Barrow.

The celebrations have been constant since Barrow won, triggering the small west African country’s first ever democratic transfer of power.

Darboe said: “President Jammeh has never won an election in this country, he has only rigged them. He calls himself a democrat, so I think he has no choice but to accept the result of the elections.”

Facebook Twitter Pinterest Tight security at the Gambia’s supreme court in Banjul, where Ousainou Darboe and 18 others attended a bail hearing on Monday. Photograph: Jerome Delay/Associated Press

Antouman Gaye, the prisoners’ lawyer, asked the judge for bail and said that it was in the public interest for the case to be thrown out and Darboe and his colleagues freed.

“We cannot with all due respect bury our respective heads in the sand and pretend there are no exceptional circumstances. This must come to a stop,” he said, before quoting Lord Denning, the celebrated English judge: “I know your ladyships and lordship. When I look at you I see bold spirits, not timorous souls.”

The Darboe family griot, or storyteller, stood up in court, loudly singing the praises of the lawyers in his red cap and yellow robe. After the ruling, Gaye said that it was “a vindication of the country’s democratisation process, which has just begun”.

He called for “a total overhaul of the judicial system” in the Gambia.

Eleven of the 19 prisoners are members of the UDP executive, and lawyer Amie Bensouda said that they were needed to lead the democratic transition.

“The transition period is a short one and the leadership of the UDP have a crucial role to play in this process,” she said. “They will not be able to do so unless this court grants them bail today. Every day counts.”

The director of public prosecutions did not oppose the bail application.

“I do not have much to say because there’s not much to be said. The practice in the court of appeal is always to entertain bail application formally,” Hadi Saleh Barkum said, denying that there was anything unusual about this.

“It’s normal. There’s nothing strange, it’s all great,” he said.

Facebook Twitter Pinterest Supporters celebrate after Ousainou Darboe, who had been jailed for taking part in a protest, was freed on bail. Photograph: AFP/Getty Images

While they are the most prominent, the 19 prisoners in court were not the only ones jailed under Jammeh, according to Sabrina Mahtani from Amnesty International.

“This is a really joyful moment for the detainees and their families,” said Mahtani. “We need to remember that there are still many more people still in prison for voicing their opinions or being perceived as opponents to the regime and there are people who have disappeared who we still don’t know anything about.”