Baghdad (AFP) - Iraq is establishing a financial "loophole" to continue buying vital gas and electricity from Iran despite US sanctions, AFP has learned, mirroring a European mechanism that came into effect Friday.

The "special purpose vehicle" (SPV) would allow Iraq to pay for imported Iranian energy in Iraqi dinars, which Iran could use to exclusively buy humanitarian goods, three senior Iraqi officials said.

The workaround would allow Baghdad to keep the lights on and avoid shortage-driven protests without triggering US sanctions, as it treads an increasingly precarious tightrope between its two main allies Tehran and Washington.

One senior government official told AFP it was the product of months of talks between Iraqi, Iranian and US officials.

"The Iraqi government will continue to pay Iran for gas by depositing money into a special bank account inside Iraq, in Iraqi dinars," the official said.

"Iran will not be able to withdraw the money, but will be able to use it to purchase goods from outside Iraq."

Iraq has an outstanding bill of around $2 billion for previous gas and electricity purchases, according to Iranian Oil Minister Bijan Zangeneh.

A US official told AFP that Washington was aware of the mechanism's creation.

The US embassy in Baghdad declined to comment, while Iran's embassy did not respond to an AFP request.

Two additional high-level Iraqi officials confirmed Baghdad was establishing such an account with US knowledge, but could not say whether payments into the account had begun.

"How else is Iraq supposed to pay what it owes Iran? We have no other choice," the second official said.

- 'Iran's ATM' -

To offset its notorious power shortages, Iraq imports around 1,400 MW of electricity and 28 million cubic meters (988 million cubic feet) of gas for power stations from neighbouring Iran, which together make up about a third of Iraq's power supply.

That reliance has angered the US, which slapped tough sanctions on Iran last year but has granted Iraq several temporary waivers to keep purchasing Iranian power until October.

Story continues

The US insists Iraq wean itself off Iranian energy, but Baghdad has said that could take up to four years, during which it would need to keep purchasing at least Iranian gas.

To do so, the central banks of Iran and Iraq agreed in February to create a payment method that steers clear of US sanctions, Iran's state news agency IRNA said, without providing additional details.

That would mean not dealing in US dollars and purchasing only "humanitarian goods" allowed by the US -- like food and medicine.

"We would become Iran's ATM," another Iraqi official told AFP.

According to two of the senior Iraqi officials, Baghdad’s SPV would likely be set up at the Trade Bank of Iraq.

The TBI has handled most of the Iraqi government's international transactions since its establishment in the aftermath of the US-led invasion in 2003.

A senior TBI source told AFP the bank had been involved in the negotiations but the account had not yet been created.

"The US Treasury has confidence in the TBI's processes. We are in discussions to reach an agreement, which would be fully within US exemptions," the source said.

- 'Like a ledger' -

It would effectively be a "loophole" around sanctions, said Ahmed Tabaqchali, senior fellow at the Sulaymaniyah-based Institute of Regional and International Studies.

"It's like a ledger. You record the money paid, and Iran has that much credit in Iraq," Tabaqchali told AFP.

The system would work much like INSTEX, a mechanism recently activated by Britain, Germany and France to trade legitimately with Iran without falling foul of US sanctions.

Still, the system is fraught with political, financial and practical complexities.

Iraq's economy relies almost exclusively on oil revenues, paid in dollars, which leaves Baghdad extremely vulnerable to any punitive measures the US could take in response to a violation.

It also remains unclear what exactly Iran could purchase from Iraq as trade is heavily tilted in the other direction.

"Credit would develop in Iran's favour but how would it actually cash it?" said Tabaqchali.

Importing goods from outside Iraq would require a third party willing to take the political and financial risk of such a transaction, he told AFP.

And, ultimately, much of Iraq's transactions with Iran are cash purchases of commercial goods -- something US authorities implementing sanctions are unable to monitor.

"Cash is untraceable," said Tabaqchali.