Zimbabwean opposition politician Tendai Biti has appeared in court in handcuffs on charges of inciting violence after he was deported from Zambia.
Zambia’s government rejected Mr Biti’s request for asylum on Wednesday.
Zimbabwe’s President Emmerson Mnangagwa said Mr Biti had been released on bail following his intervention.
Prosecutors accuse Mr Biti of fuelling illegal protests by rejecting Mr Mnangagwa’s victory in the fiercely contested elections on 30 July.
At least six people were killed two days after the vote in clashes between security forces and MDC Alliance supporters who alleged that their leader, Nelson Chamisa, had been robbed of victory.
There was great optimism that the elections would bring real change after the end of Robert Mugabe’s 37-year rule in November.
But the MDC Alliance says the security forces have launched a brutal crackdown on the opposition following the disputed poll.
Mr Biti is the first senior opposition politician to be detained since Mr Mnangagwa took over from Mr Mugabe.
A handcuffed Mr Biti was brought to court in the capital, Harare, under a strong police presence.
Prosecutors say he falsely declared Mr Chamisa the winner of the election, and encouraged his supporters to damage property during protests against the election results.
Mr Biti was freed on $5,000 (£4,300) bail, and ordered to surrender his passport.
“We will keep on fighting,” he told reporters.
In a tweet, Mr Mnangagwa said his intervention led to Mr Biti’s release.
“At such a crucial time in the history of the new Zimbabwe, nothing is more important than unity, peace and dialogue,” he added.
However, Mr Mnangagwa said that because of the “serious nature of the allegations” against Mr Biti, “due process will continue”.
Meanwhile, the UN refugee agency said it was “gravely concerned” by reports that Mr Biti had been deported while trying to claim asylum in Zambia.
“Forcibly returning refugees and asylum-seekers to their country of origin is a serious violation of international refugee law,” the agency said in a statement.
Mr Biti’s lawyer Gilbert Phiri said Zambia’s High Court ruled on Wednesday night that Mr Biti should not be deported until a “judicial review” of the government’s decision to reject his asylum application.
However, Zambian immigration and police officers refused to accept the court papers, and surrendered him to Zimbabwean law enforcement officers at the Chirundu border post, about 350km (220 miles) north of Zimbabwe’s capital, Harare, Mr Phiri said.
By Kennedy Gondwe, BBC Africa, Lusaka
The Zambian government has probably taken its revenge on Mr Biti by deporting him to Zimbabwe.
Mr Biti came to Zambia last year to show solidarity with opposition leader Hakaide Hichilema after he was arrested on treason charges.
He was scathing in his criticism of Zambia’s President Edgar Lungu, accusing him of behaving like then-President Mugabe by targeting Mr Hichilema. So, it is not surprising that Zambia has deported him.
Zambia’s ruling Patriotic Front (PF) party has always been a staunch ally of Zanu-PF, which has been in power since Zimbabwe’s independence in 1980. Its founding leader, the late Michael Sata, was inspired by Mr Mugabe, and like him regarded the MDC as a “puppet of the West”.
When Mr Sata formed the party in 2001, he named it PF to signal that it would forge close ties with Zanu-PF. The relationship remains strong some 17 years later, albeit with new leaders at the helm of the two parties.
Mr Biti is the most senior opposition leader to be detained since Mr Mnangagwa took office.
On Wednesday, Zambia’s Foreign Minister Joe Malanji told the BBC that Mr Biti’s grounds for asylum were weak.
The police are hunting for eight other senior opposition officials in connection with post-election violence.
The MDC Alliance has confirmed that it will challenge the presidential election result in court, saying it was marred by “mammoth theft and fraud”.
The electoral commission says there was “absolutely no skulduggery”.
Mr Mnangagwa obtained 50.8% of the vote, compared with Mr Chamisa’s 44.3%. The remaining votes went to 21 other candidates.
Mr Biti was the minister of finance in a unity government formed after disputed elections in 2008 – and is credited with helping stabilise the economy after years of hyperinflation.