Yury Dmitriyev, a Russian historian and activist who is being tried on child pornography charges his supporters say are politically motivated, has been released from pretrial custody, Russian media reported.

Novaya Gazeta quoted defense lawyer Viktor Anufriev as saying that Dmitriyev was released from the Petrozavodsk detention center in the morning on January 27 on condition that he wouldn’t leave the city without permission.

Dmitriyev was released a day earlier than expected.

On December 27, a court in Petrozavodsk, the capital of the northwestern region of Karelia, issued an order that Dmitriyev would be freed on January 28.

The court also ordered Dmitriyev to undergo a psychiatric examination and called for a new expert assessment of 49 nude photographs of his foster daughter -- the third such evaluation of the images at the center of the case.

Dmitriyev, who heads the Karelia chapter of the human rights group Memorial, has worked for decades to expose crimes committed there by the Soviet state under dictator Josef Stalin.

Investigators claim that Dmitriyev intended to use the photos, which were found in his personal computer, to create pornographic material to share online. He is charged with "preparing and distributing child pornography."

Dmitriyev and his colleagues say the photos were taken because medical workers had asked him to monitor the health and development of the girl, who was malnourished and unhealthy when he and his wife took her in at age 3 with the intention of adopting her. She is now 11 or 12 years old.

Dmitriyev was arrested in December 2016 and went on trial on June 1.

With reporting by Novaya Gazeta