LUSAKA - Zambian opposition leader Hakainde Hichilema and five others were released from prison on Wednesday, with the treason charges against them being dropped.
The group was set to stand trial for treason, in a case that threatened to rock a country known for its relative stability.
Hichilema, leader of the United Party for National Development (UPND), had been in custody since April over an incident where he allegedly failed to give way to President Edgar Lungu's motorcade.
The UPND tweeted the news of Hichilema's release on Wednesday morning.
Lungu, who narrowly beat Hichilema in last year's presidential election, dismissed allegations of growing authoritarianism and accused his rivals of trying to overturn the election result.
Hichilema and five aides denied the treason charges at a plea hearing on Monday where police officers in riot gear had sealed off the court precinct as scores of UPND supporters waited outside.
Foreign journalists were barred from proceedings.
Zambia has enjoyed relative stability since its first multi-party election in 1991.
But last year's election was marked by clashes between supporters of Lungu's Patriotic Front (PF) party and the UPND.
Hichilema (55) said the vote was rigged and refused to recognise Lungu as the president of Zambia.
Parliament suspended 48 UPND lawmakers after they boycotted a Lungu address in March.
Lungu also invoked emergency powers in July, increasing police powers of arrest and detention after he blamed opposition parties for a string of arson attacks.
The government increased pressure on media outlets that support the opposition, eroding Zambia's reputation as a stable democracy.
Hichilema was arrested after he allegedly put Lungu's life in danger when his convoy failed to make way for the presidential motorcade in a high-speed road drama caught on video camera.
The two men were both travelling to the Western province for a traditional ceremony.
Days later, more than 100 armed police surrounded Hichilema's house outside Lusaka, firing tear gas before detaining him and his aides.
A businessman turned politician, Hichilema claimed he was assaulted by police during his arrest and suffered mistreatment in detention.
Treason is an offence in Zambia that carries a minimum 15-year jail term and, in theory, a maximum sentence of death.
When he was arrested, Amnesty International said Hichilema and the five other accused were "victims of longstanding persecution" by authorities and faced charges designed to "harass and intimidate".
Lungu did not mince words during the election campaign, warning political rivals and activists that "if they push me against the wall, I will sacrifice democracy for peace".