Thailand's military government on Tuesday freed a journalist and two politicians who were detained for defying orders against criticizing its rule.

Junta spokesman Col. Winthai Suvaree confirmed the releases of Pravit Rojanaphruk of The Nation newspaper and two politicians associated with the elected government that was toppled by the army in May 2014. One of the freed politicians, former Energy Minister Pichai Naripthaphan, announced his release in a Facebook post, and Pravit did the same on Twitter.

"Released by Thai junta already. Thanks to friends, colleagues & supporters. My ideology is intact. Will talk more later. #Thailand," Pravit said in his post Tuesday evening.

His last tweet on Sunday before being detained said, "Freedom can't be maintained if we're not willing to defend it."

The Nation reported that Pravit signed an agreement not to participate in activities opposing last year's coup.

The junta says such detentions, normally for up to a week, are for "attitude adjustment."

The detentions drew sharp criticism from international human rights and media groups.

"Amnesty International was appalled by the detention of these prisoners of conscience and disappointed that their release was accompanied with tight restrictions," Josef Benedict, deputy director of its Southeast Asia and Pacific regional office, said in a statement. "This is release but no freedom. Release restrictions that tightly muzzle hundreds who have been arbitrarily detained, and military powers of detention violate Thailand's international human rights obligations on the right to liberty, movement, freedom of association and expression."

It was the second time Pravit had been detained by the junta, which called in large numbers of politicians and potential dissidents in the months after the coup, and recently appears to have resumed a crackdown on dissent. The junta's position is that criticism could destabilize the nation, which it says needs unity after almost a decade of sometimes violent political conflict.

In his Facebook post, Pichai thanked the media for reporting his situation and his friends and rights groups for seeking his release. The former energy minister, who had been publicly critical of the junta's economic policies, said that because of the unusual political situation, he would refrain from giving further interviews on the economy or the effects of politics on it.

He added, however, that he believed time would prove everything he had already stated, while saying he wished to support the government's efforts to solve the country's problems.

Pichai and the other released politician, Karun Hosakul, are members of the Pheu Thai party of former Prime Minister Yingluck Shinawatra, who was forced out of office by a controversial court decision shortly before last year's coup. A 2006 military coup ousted the government of her brother, former Prime Minister Thaksin Shinawatra.