Supporters hold a banner depicting Recep Tayyip Erdogan during a demonstration in Istanbul on July 19, 2016 in the wake of a failed coup against the Turkish president

Anti-secrecy website WikiLeaks has released nearly 300,000 emails linked to Turkish President Recep Tayyip Erdogan's ruling AKP party, with Turkey immediately blocking access on Wednesday.

WikiLeaks said the emails came from the party's web domain akparti.org.tr and mainly related to world affairs and not "the most sensitive internal matters".

It said the emails, which date between 2010 and July 6 this year, were obtained before the attempted coup of July 16.

"WikiLeaks has moved forward its publication schedule in response to the government's post-coup purges," the transparency website said in a statement.

The source of the emails "is not connected, in any way, to the elements behind the attempted coup, or to a rival political party or state", it said.

A Turkish official said the WikiLeaks website was being blocked "due to violation of privacy and publication of illegally obtained data".

The coup represented the most serious threat to Erdogan's 13-year domination of Turkey and the president has said he came within 15 minutes of being killed or kidnapped by the plotters before escaping.

Tens of thousands of people including soldiers, police officers, judges and teachers have since been either detained or sacked in a widening purge.

The putsch left over 300 dead and caused scenes of devastation, especially in Ankara where raids by F-16s and attack helicopters on strategic targets terrified residents and turned parts of parliament and the police headquarters to rubble.

Founded in 2006 and launched a year later by Australian ex-hacker Julian Assange, WikiLeaks came to prominence in 2010 when it released the video of a US helicopter strike in Baghdad that killed two Reuters staff.

Later that year it released tens of thousands of internal US military documents relating to the wars in Afghanistan and Iraq, detailing cases of abuse, torture and civilian deaths.

It then leaked 250,000 diplomatic cables from US embassies around the world which deeply embarrassed Washington.