US journalist Danny Fenster has been released from prison in Myanmar after he was sentenced to 11 years in jail by a military court three days ago.
He was "pardoned" before being freed on "humanitarian grounds", the military government said.
The release was secured after negotiations between the junta and former US ambassador to the UN, Bill Richardson.
Fenster's employer, Frontier Myanmar, said he was on a flight out of Myanmar.
Fenster, who was managing editor of the English-language news site, had been convicted of breaching immigration law, unlawful association and encouraging dissent against the military.
He was set to stand trial on further charges of sedition and terrorism on Tuesday, which carry a possible life term in prison.
Fenster was first detained in May as he was about to fly back to the US, and spent 176 days in prison.
He is one of dozens of journalists, and thousands of people overall, to be held since Myanmar's military took power in a coup in February.
US Secretary of State Antony Blinken said Fenster had been "wrongfully detained for almost six months", and welcomed his release.
"We are glad that Danny will soon be reunited with his family, as we continue to call for the release of others who remain unjustly imprisoned" in Myanmar, Mr Blinken said.
Mr Richardson said he had negotiated Fenster's release in face-to-face meetings with Gen Min Aung Hlaing, the army general who seized power.
Mr Richardson said Fenster would be flying home to the US via Qatar.
"This is the day that you hope will come when you do this work," he said.
Speaking to the BBC on Monday, Maj-Gen Zaw Min Tun, Myanmar's deputy minister of information, said the country "already had the intention to release" Fenster and was doing so for "humanitarian reasons".
He denied that the US had promised anything in return for the release, saying it was Myanmar's policy to "keep good relations with other countries".
According to Frontier, Fenster had previously worked for Myanmar Now, an independent news site that has been critical of the military.
"The charges were all based on the allegation that he was working for banned media outlet Myanmar Now. Danny had resigned from Myanmar Now in July 2020 and joined Frontier the following month, so at the time of his arrest in May 2021 he had been working with Frontier for more than nine months," the news site said previously.
Fenster's brother, Bryan, said his family could not wait to have him home again.
"We are overjoyed that Danny has been released and is on his way home - we cannot wait to hold him in our arms.
"We are tremendously grateful to all the people who have helped secure his release, especially Ambassador Richardson, as well as our friends and the public who have expressed their support and stood by our sides as we endured these long and difficult months."
It is always difficult to guess the motives of Myanmar's reclusive military rulers; never more so than in their treatment of Danny Fenster.
He was arrested when about to board a flight back to the US in May, although he had committed no obvious crime. He was charged with offences relating to a news organisation he had left almost a year before, an apparent error pointed out by his lawyers in court.
He was excluded from an amnesty of more than 5,000 prisoners last month, and last week he was not only convicted and given an 11-year jail sentence, but had two more serious charges filed against him.
His sudden release follows months of quiet pressure by the Biden administration, and a recent visit to Myanmar by Bill Richardson. It is unclear, though, whether the US made any concessions to win Fenster's release.
The sanctions targeting members of the military junta and their associates are still in place. Dozens of local journalists remain in custody, along with thousands of other political prisoners. There is no suggestion yet that they too might be freed.
Myanmar's military leaders seized power in February after suffering a massive election defeat at the hands of the ruling National League of Democracy.
They said they had been forced into the move by widespread vote fraud, although the country's election commission said there was no evidence to support such claims.
Mass civilian protests rose up across the country, and were brutally suppressed by the military.
Since then, at least 1,265 people have been killed and 7,291 are under detention in a crackdown on dissent, according to the Assistance Association for Political Prisoners (AAPP).