ISTANBUL - The central banks of Turkey and the United Arab Emirates said on Wednesday they signed a swap agreement worth nearly $5 billion in local currencies, providing a possible source of support as Ankara faces economic turmoil.

The deal aims to promote bilateral trade and strengthen financial cooperation between the two regional rivals that have sought to warm ties in recent months, the banks said. It will last for three years with the possiblity of extension.

Last month Reuters reported, citing officials, that talks between the Turkish central bank and its UAE and Azeri counterparts were wrapping up with at least one deal likely soon. 

The nominal size of the deal is 64 billion lira and 18 billion dirham, the central banks said in separate statements.

Turkey could tap the swap line to bolster its depleted FX reserves, after expensive market interventions begining last month to stem a currency crisis. The lira was 0.5% weaker at 13.6 against the dollar at 0737 GMT.

The agreement comes after the visit of Abu Dhabi Crown Prince Sheikh Mohammed bin Zayed al-Nahyan to Turkey late last year as the two countries work to repair ties that have frayed in recent years.

Turkey's central bank has swap deals with China, Qatar and South Korea worth about $23 billion. ($1 = 13.5307 liras)

(Reporting by Daren Butler; Editing by Jonathan Spicer) ((daren.butler@tr.com; +90-212-350 7053; Reuters Messaging: daren.butler.thomsonreuters.com@reuters.net))