Trafigura logo is pictured in the company entrance in Geneva Thomson Reuters LONDON (Reuters) - Trafigura, one of the world's biggest commodities trading firms, played a pivotal role in helping Iraq's semi-autonomous Kurdish region export oil, which the Iraqi government considered illegal, three sources familiar with the trades said.

This week Iraq and its Kurdish region reached a landmark deal designed to resolve a dispute over oil exports which had threatened to break up Iraq, after seven months during which the Kurds defied Baghdad to sell oil on their own.

The Kurds have long argued that they are permitted to sell oil under Iraq's 2005 constitution, provided the revenue is shared with the rest of Iraq according to an agreed formula. The government in Baghdad says only the central authorities can sell oil, and threatened to sue buyers who deal with the Kurds.

Swiss-based Trafigura's role in the trade has not been revealed until now. A Trafigura spokesman declined to comment, as did a spokesman for the Iraqi Kurdish regional government.

According to the three sources, who revealed the commercial information on condition of anonymity, Trafigura became involved in Kurdish oil sales after the Kurds achieved poor results from initial attempts at exports early this year. Ships had been loaded but ended up sailing aimlessly, with few buyers willing to brave Baghdad's anger to take delivery.

Since Trafigura began handling some of the sales in recent months, all of the 30-plus tankers have found buyers, apart from one for which Trafigura was not responsible, the sources said.

Trafigura struck its deal to sell Kurdish oil with the Kurdish regional government this summer after meetings in London and the Kurdish capital Arbil, the sources said. At the time, a lightning advance of Islamic State militants in northern Iraq threw the Kurds into front-line battle.

The oil was delivered to destinations such as Israel, Croatia and to buyers off the coast of Malaysia, according to trading sources and publicly available ship-tracking data. A series of ship-to-ship transfers and temporary storage arrangements was put in place, often making it difficult to track final destinations.

RESOLVING DISPUTE

Iraqi oil ministry officials were not available to comment on the role of Trafigura in the trade. Baghdad has not made clear whether it will lift its threat to sue firms involved in past transactions with the Kurds following this week's deal to resolve the dispute.

Asked at a press conference two weeks ago about plans to sue over past deals, Iraqi oil minister Adel Abdel Mehdi declined to comment, saying he did not want to spoil the positive relations between the Kurds and the new Iraqi government which took power three months ago.

Kurdish officials said they had no choice but to sell oil this year because Baghdad had halted payments to the region of its share of total oil revenue.

Resolving the dispute became more urgent in recent months as the Kurds ramped up their oil sales, even as both sides faced a resurgent threat from Islamic militants. Kurdish leaders threatened to seek independence, breaking up Iraq.

Washington, which is helping both the central government and the Kurds battle Islamic State fighters, put pressure on them to resolve their differences.

Under this week's deal, the Kurds will receive 17 percent of Iraq's oil revenue and the central government will pay the salaries of the Kurds' security forces known as peshmerga.

By the time Baghdad and the Kurds reached their agreement this week, Kurdish exports had risen to around 300,000 barrels per day, more than a tenth of Iraqi output. Some industry sources predicted the Kurds could be selling 1 million bpd by next year.

The identity of the trader behind the sales has until now been a closely-guarded secret, with Baghdad threatening not only to sue but to bar any company that assisted the Kurds from handling Iraq's sizeable exports from the south.

Trafigura does not handle any of Baghdad's own oil sales from state marketer SOMO, unlike some of its biggest rivals.

Trafigura was not behind the one Kurdish vessel still stuck in limbo off the coast of Texas, the United Kalavrvta, the source familiar with the trades said. A Texas judge has said the state lacks the jurisdiction to rule on the ownership of the oil.

(Additional reporting by Raheem Salman in Baghdad; Editing by Peter Graff)