Turkey's shadowy spy chief Hakan Fidan has faced an unprecedented public dressing down in the wake of the failedcoup butappears set to stay on in his post -- at least for now.

There has been intense speculation over the future of Fidan, head of the National IntelligenceOrganisation(MIT) and widely seen as one of Turkey's most powerful men, after President Recep Tayyip Erdogan said intelligence lapses had helped last week's coup.

Erdogan late on Friday held a two-hour meeting with Fidan at the presidentialpalace butthere was no statement afterwards that Turkey's top spy was to go.

Indeed, the most significant development -- much to the amusement of social media users -- was that the usually clean-shaven spy chief had grown amoustachein what some saw as an expression of loyalty to the similarlymustachioedpresident.

"No, he did not offer his resignation. We did not discuss this," Erdogan said in an interview with France 24 television.

Following reports that MIT caught wind of the coup hours beforehand but did not warn Erdogan, the president admitted there had been an intelligence failure.

"There was a weakness regarding intelligence, a failure," Erdogan said, at the same time noting that such failures had also been seen in the United Statesoverthe September 11, 2001 attacks and the recent attacks in Belgium and France.

He said Fidan and Hulusi Akar -- the military chief of staff who was held hostage by the plotters -- would be staying on but their positions were under review.

"If we have to make a decision (on their future) I will weigh it with my Prime Minister (Binali Yildirim)," Erdogan said.

"At present we are in a transition period -- we have a saying, 'you do not change the horse half-way down the road'."

According to the Hurriyet daily, Erdogan had furiously scolded Fidan following the coup, saying: "You got a really bad mark."

To which Fidan replied: "Whatever you command, I am ready to do."


'Why didn't you share?'

Erdogan had previously complained of finding out about the coup not from the intelligenceservice buthis brother-in-law -- and then, extraordinarily, of being unable to reach Fidan.

Meanwhile Yildirim said he found out 15 minutes after the coup took place, having had no idea of the impending threat.

"Even looking at things in the most positive way, there was an intelligence weakness," Deputy Prime Minister Nurettin Canikli told NTV television.

"Imagine -- this news comes out and the president cannot reach the head of the main intelligenceorganisation."

Adding to the intrigue, the military chief of staff's office said it had been tipped off by the MIT about the coup at 4:00 pm local time, raising the question of why the political leadership was not informed sooner.

"Dear Mr Hakan Fidan...whenyou got the secret news of the coup, why did you not share this with a single politician?" asked Hurriyet columnist Ahmet Hakan.

According to a report by the CNN Turk channel, the MIT's rapid alert resulted in ameetingsbetween Fidan and Turkey's top generals at 5:30 pm on July 15.

They then took measures that forced the plotters to bring forwards the timing of the coup, which was to have started at 03:00 am the next day with martial law declared at 6:00 am.

But it remains a mystery why the political leadership was not involved.

Fidanwas named to head MIT by Erdogan in May 2010 after serving as his foreign policy advisor for three years.

Until now, he had always been seen as one of the president's most loyal servants, with Erdogan openly describing Fidan as his "secret keeper".

In a bizarre sequence of events that remains unexplained, Fidan in February 2015 resigned as head of MIT with the aim of becoming an MP.

However Erdogan kicked up a fuss and thespymaster-- who had in the past held secret talks with jailed Kurdish militant leader Abdullah Ocalan -- was soon back in his old job.