ANKARA, April 8 (Reuters) - Turkey’s intelligence agency played a key role in diplomatic efforts leading to ‌a two-week ceasefire between the United States and ‌Iran, Turkish media reported on Wednesday, citing security sources.

Washington agreed late on ​Tuesday to the truce, brokered by Pakistan, in a conflict that has spread across the Middle East and disrupted global energy supplies.

State news channel TRT said Turkey's National ‌Intelligence Organization (MIT) was among ⁠the few actors able to maintain direct contact with both Western countries and neighbouring ⁠Iran, including its Islamic Revolutionary Guard Corps (IRGC).

It said MIT had worked to keep communication channels open, prevent misunderstandings, relay ​messages aimed ​at de-escalation, presented proposals to ​help avoid further escalation ‌and coordinated with multiple intelligence services.

MIT was not immediately reachable for comment on the report.

While Pakistan led mediation efforts, Tehran has said that Turkey had played a role after having initially sought to host direct U.S.-Iran talks ‌before the war began in ​late February. A Turkey-based diplomat separately ​said Ankara played ​a supportive role in the recent weeks of ‌talks.

Turkish President Tayyip Erdogan, whose ​country is ​a NATO ally of the U.S. and shares a border with Iran, on Wednesday welcomed the ceasefire, ​called for its ‌full implementation, and warned against any provocations or ​acts of sabotage.

(Reporting by Ece Toksabay; Editing by ​Jonathan Spicer and Gareth Jones)