The head of Turkey’s intelligence agency, one of the most loyal allies of the president, Recep Tayyip Erdoğan, has resigned to stand for election as an MP.

The resignation of Hakan Fidan, who has headed the National Intelligence Agency (MIT) since 2010, has been accepted by the prime minister, Ahmet Davutoğlu, and will take effect on Tuesday, it added.

Turkey’s press have in the last days speculated feverishly about the possibility of Fidan becoming an MP in the June legislative elections, saying it could set him up to become foreign minister.

Seen only occasionally in public and rarely making public comments, Fidan has emerged as one of the most powerful men in Turkey under Erdoğan.

As head of the MIT, he has led negotiations with Kurdish militants for an end to a decades-long insurgency and has been a key player in Turkey’s policy on the Syria crisis.

Under Turkish law, state officials wishing to stand in the elections must resign their posts by 10 February.