The United States has reached an agreement in principle with Iraq to extend for 90 days an exemption to sanctions against Iran, allowing Baghdad to keep importing Iranian gas that is critical for Iraqi power production.

The extension was reached on Dec. 20, when a previous 45-day waiver was due to expire, during a visit to Washington by an Iraqi delegation, according to two Iraqi officials with direct knowledge of the negotiations.

A senior Iraqi government official and a central bank official told Reuters that talks were continuing on Friday to finalise details, including how to pay Iran for energy imports, two sources said.

The administration of President Donald Trump has said Iraq should not pay Iran in U.S. dollars or euros. A team from Iraq's central bank joined the delegation to find a solution.

Washington initially granted Iraq a 45-day waiver for Iranian gas when it reimposed sanctions on Nov. 5, after months of negotiations.

Iraq relies heavily on Iranian gas to feed its power stations, importing roughly 1.5 billion standard cubic feet per day via pipelines in the south and east.

Iraqi officials have said they need about two years to find an alternative source.

Washington has said it wants to roll back Iranian influence in the Middle East, including in Iraq, where Iran holds broad sway over politics and trade.

Iraqi Prime Minister Adel Abdul-Mahdi said on Dec 11 that the U.S. was working with Iraq on the issue of Iranian gas because it was "linked to a very sensitive issue which is electricity".

Persistent power shortages fuelled protests this summer in the south of Iraq, which is still reeling from a three-year war against Islamic State.

The prime minister, who took office in October, met U.S. Energy Secretary Rick Perry in Baghdad this month. Perry, who came with a delegation of more than 50 business people, also met Iraq's oil and electricity ministers.

Iraq has reached a deal with U.S. energy giant General Electric and German rival Siemens to install liquefied natural gas-operated mobile power units at some small southern oil fields, Iraq's state newspaper reported last month.

The Financial Times reported in October that the U.S. government had intervened in favour of GE for a contract sought by both companies to supply 11 gigawatts of power generation equipment, reportedly worth around $15 billion.