Kamjai Khong Thavorn, 53, should have been released in 2007 after serving a 20-year sentence for heroin possession but a clerical error wrongly stated his first year in prison as 1997 instead of 1987, the Jakarta Globe reported.
Kamjai was released Thursday after he told Indonesia's justice minister of the mistake during a chance meeting on the minister's tour of the maximum security prison in Central Java, it said.
"We realized the mistake that was made, so he was released unconditionally," the prison's warden, Sutrisman, told the newspaper.
Kamjai has been taken to the Thai Embassy in Jakarta, the warden said.
Officials at the justice ministry and prison could not immediately be reached for comment Friday.