Iraq is close to finalizing a deal that will allow it to import Iranian energy despite American sanctions by avoiding the U.S. dollar, an Iraqi official said.

“A big delegation came from the Iranian central bank and the idea was proposed to trade with Iran in euros,” Abdulkarim Hashim Mustafa, special adviser to Iraq’s prime minister, said in an interview Tuesday in Moscow on the sidelines of a Middle East conference hosted by the Kremlin-backed Valdai discussion club. “There are other ideas to pay in Iraqi dinars, or in oil.”

The U.S. has been pressuring Iraq to end its purchases of Iranian natural gas and electricity, which meet a large share of domestic energy needs. In the meantime, it has extended to Baghdad a temporary waiver from the sanctions targeting Iran that President Donald Trump reimposed last year after pulling out of the Iranian nuclear deal. Mustafa said​Iraqi Prime Minister Adel Abdul Mahdi’s government has rebuffed the U.S. pressure to cut energy ties with Iran, adding to strained ties with Washington over Trump’s vow to keep troops in Iraq indefinitely to “watch” the Islamic Republic. The two majority Shiite neighbors have become close allies since the 2003 U.S.-led overthrow of Saddam Hussein.

“These are American sanctions and we have the right to protect our national interests,” Mustafa said. “We tell them always: we are your friends but we are not part of your policies in the region. The Americans are well aware of this -- it isn’t news for them.”​Iraq doesn’t expect the American forces to stay for an indefinite period of time, the official said. “When the Iraqi side asks the American side to pull out, they will withdraw as they have done in the past,” he said. “As the terrorist threat recedes, the U.S. will scale back its military presence in Iraq.”