Tanzanian journalist Erick Kabendera, who was held in jail for seven months in a case that prompted international concern, was freed on Tuesday after pleading guilty to economic crimes.
Kabendera, a reporter for local and international press outlets, was initially detained for questioning over his citizenship before the charges were upgraded to sedition.
But both lines of enquiry were dropped, and Kabendera was charged in August with tax evasion, money laundering and organised crime.
His detention provoked outrage, with rights groups demanding Kabendera be released and warnings that the case reflected worsening press freedoms under President John Magufuli, who came to power in 2015.
After plea bargaining the count of organised crime was dropped, and Kabendera pleaded guilty to counts of money laundering and failure to pay 173 million shillings ($74 000) in taxes.
Kabendera was freed after paying a 250 000 shilling fine for failing to pay taxes, but has to pay another 100 million shillings in fines for money laundering.
The journalist, whose case has been postponed multiple times, with him even being denied release to attend his mother's funeral, said he "appreciates the support of everyone."
"I have gone through difficult times and finally I am free. I did not expect this but I am grateful for all the support," he said.
Defence lawyer Jebra Kambole said the remaining fine would be paid in instalments.
The United States and Britain have voiced concern at the "steady erosion of due process" in Tanzania, citing Kabendera's plight as a case in point.
Reporters Without Borders (RSF) - which has labelled Magufuli a "press freedom predator" - and Amnesty International, among other rights groups, had demanded Kabendera's immediate release.
Kabendera had written about being stalked and harassed in the years since Magufuli's election.
Magufuli, nicknamed "The Bulldozer", has shut down newspapers, banned opposition rallies, switched off live broadcasts of parliamentary sessions and used the cybercrimes law to jail critics.