According to Iranian media, Turkish President Recep Tayyip Erdogan was warned by Russian intelligence of an imminent coup just hours before tanks appeared in the streets of Istanbul and Ankara last Friday.

Last week, the Russian army intercepted Turkish military communications that indicated a coup was being organized against the government of Turkish President Recep Tayyip Erdogan, according to Fars News. This information was then passed on to Turkey’s National Intelligence Organization (MIT), diplomatic sources told the news agency.

The intercepted transmissions included helicopter communications ordering soldiers to arrest or kill the Turkish president in the resort town of Marmaris.

While relations have been tense between Ankara and Moscow since the November 2015 downing of a Russian Su-24 bomber in Syrian airspace, the situation improved after Erdogan issued a formal apology to Russian President Vladimir Putin last month.

"The diplomatic sources said the shift in Erdogan’s foreign policy stated only a week before the coup has been 'a major cause pushing several foreign states to provoke and promise support for the army to stage the coup, and the same shift also saved him,'" Fars News reports.

While neither government has issued a statement on the claims, an official statement released by the Turkish army on Tuesday did indicate that some kind of warning was received by MIT.

The failed coup attempt left nearly 300 people dead and over 1,000 injured, and has been blamed on supporters of exiled religious and political leader, and former Erdogan ally, Fethullah Gulen. Ankara has filed a formal request with the US government for Gulen’s extradition.

In the wake of the coup attempt, Ankara has launched an unprecedented crackdown on those suspected of being involved in the events of last week. Nearly 50,000 individuals have been targeted as part of a purge, including military personnel, educators, judges, and civil servants.

Earlier on Wednesday, Erdogan declared a three-month state of emergency, "in order to remove this threat as soon as possible."

The Turkish president also suggested that foreign nations may have played a role in failed takeover.

"Other states could be behind this coup attempt," he said.

"Gulenists have a 'supreme intelligence,' which could have plotted all this. The time will come for all these links to be revealed."