The US secretly warned Iran that ISIS was planning a potential terror attack inside Iran’s borders before the group carried out a deadly attack near the burial site of slain military commander Qasem Soleimani on January 3, according to a US official.

The private warning was based on intelligence the US had obtained about ISIS’ plans and was given to Iran based on the US government’s “duty to warn” policy, the official said. That policy applies even to US adversaries.

The private warning, first reported by The Wall Street Journal, is notable not only because Iran is not a US partner or ally, but also because officials say Iran is behind a recent uptick in attacks by its proxy militias against US personnel in the Middle East. It is not clear through what channels the US delivered the message to Iran given that the countries have no formal diplomatic relations.