ALMATY (Reuters) - A court in Kazakhstan on Thursday ordered the release on parole of opposition activist Vladimir Kozlov, his lawyer said, after spending nearly five years in jail accused of participating in a failed attempt to overthrow the government.

Kozlov, a vocal critic of autocratic Kazakh President Nursultan Nazarbayev, was sentenced to seven-and-a-half years in prison in October 2012 after being found guilty of trying to rally striking oil workers into toppling the government.

This was followed by rioting in December 2011 in which 15 people were killed, violence that dented the Central Asian state's reputation for political stability.

Foreign oil majors are heavily invested in Kazakhstan's oil industry and the country has an annual output of around 80 million tonnes of crude.

Kozlov denied the charges and denounced his trial as politically motivated, an accusation echoed by the United States and human rights bodies abroad.

"The plea to release him on parole was approved by the town court of Kapchagai today," Kozlov's lawyer Aiman Umarova told Reuters. "If this decision is not appealed against, it will come into force in 15 days," she said.

The 2011 riots in Zhanaozen in Kazakhstan's west were the biggest challenge to Nazarbayev since he took power in 1989.

A former steelworker who rose through the ranks of the Soviet Communist party, Nazarbayev, 76, tolerates little dissent. He has overseen market reforms and attracted foreign investment, primarily for oil and gas.

(Reporting by Maria Gordeyeva; Additional reporting by Raushan Nurshayeva; Writing by Dmitry Solovyov; Editing by Raissa Kasolowsky)