Danish writer Lars Hedegaard is pictured in this 2009 file photograph, made available on 5 February, 2013. (Reuters)

The suspected gunman for the attempted murder of Danish writer and critic of Islam Lars Hedegaard has been freed by Turkey allegedly as part of a prisoner swap with Isis (Islamic State), according to Danish media.

Basil Hassan, 27, is accused of shooting at the 70-year-old scholar in 2013 in his house. Hedegaard is an outspoken Islam critic and former newspaper columnist who was targeted ahead of the launch of a weekly newspaper, Dispatch International, containing articles that stigmatise radical Islam.

Hassan left Denmark on the same day and lived in Syria before being arrested in Turkey.

Danish media speculated that Hassan was released as part of a hostage swap for 46 Turks that were detained by IS militants in Syria. The Danish government lobbied for his extradition but Ankara ignored requests for information. Prime Minister Helle Thorning-Schmidt called Turkish silence on the matter "unacceptable".

The Turkish foreign ministry said Hassan was freed after appealing an extradition process, but did not elaborate further. However, the Hurriyet news site reported that the suspected gunman was allegedly freed two months before the prisoner's swap.

A leading advocate of free speech under Islam, Hedegaard founded both the Free Press Society and the International Free Press Society following a row with PEN international, an association of writers, caused by his, I Krigens Hus ("In the War's House"), which discusses Islamic immigration to Western Europe from a historical viewpoint. PEN called the book a hate speech.

The writer expressed support for outspoken Islam critics in Europe including Swedish artist Lars Vilks, who sparked the Mohammed cartoon controversy in 2007, and far-right Dutch lawmaker Geert Wilders.