Updated

A Syrian Kurd who threw a shoe at Turkey's prime minister in Spain has been released from prison a few months early.

Hokman Joma tried to hit Recep Tayyip Erdogan with a shoe in February 2010 during a visit to the southern city of Seville, but it flew over Erdogan's head.

Hokman shouted "Long live Kurdistan" before being arrested. Turkey has been battling Kurdish rebels since 1984.

Joma was sentenced to three years in prison. But Spain's Justice Ministry says he was pardoned Friday on the condition he stays out for trouble for three years.

An Iraqi journalist who tried to hit former U.S. President George W. Bush with his shoes in Baghdad in 2008 had a three-year sentence reduced to one year.