Iran says it is working on an agreement to sell oil to Europe in face of returning US sanctions that ban purchases of oil from the country.

Iran’s Foreign Minister Mohammad Javad Zarif told reporters in New York that the Islamic Republic was close to a deal with Europe over oil sales.

Zarif said this was part of Iran’s efforts to break efforts by the administration of US President Donald Trump to cut off the country’s revenues.

“This is for us to sell our oil and get the proceeds,” he was quoted as saying by US media. The Iranian minister further emphasized that under UN resolutions passed when the 2015 nuclear deal was signed with Tehran, countries would have the legal right to trade with the Islamic Republic.

Earlier, EU foreign policy chief Federica Mogherini was quoted by media as saying that EU was working over for an oil-for-goods bartering mechanisms with Iran.

Mogherini said a mechanism to the same effect could be devised by November before US President Trump issued the next round of sanctions that would target banks, businesses and countries that conduct business with Tehran.

At the core of the agreement that Iran and Europe are trying to forge is a mechanism for paying for Iran’s oil in barter and local currencies, rather than in American dollars, according to a report by the New York Times. The idea is to route around the United States and prevent it from blocking financial transfers — and perhaps from identifying those involved in the transactions.

Elsewhere in his remarks, Zarif said Iran was also working on a separate mechanism to conduct international trade in currencies other than the US dollar.

“The actual mechanism would be to avoid dollars,” Iran’s top diplomat said, adding that countries were starting to make agreements to use their own currencies in bilateral trade.

“You can use your own currency,” Zarif was quoted as saying by the Washington Post. “Sell stuff in your own currency, buy stuff in the other country’s currency, and at the end of a specific period, balance it out in a non-dollar currency. It’s quite possible and may even be profitable.”