Afghan President Ashraf Ghani revealed Thursday that he had received the Secretary of Iran’s Supreme National Security Council, Ali Shamkhani, in his office, shortly after reports verified that Iranian government officials have been in touch with the Taliban amid peace talks with the U.S.

The Pentagon has accused the Iranian regime of cooperating with the Taliban in the past, despite Tehran being governed by a Shiite theocracy and the Taliban being a Sunni Muslim terrorist group. Iran also boasts significant ties with Afghanistan and has welcomed an estimated thousands of Afghan refugees, many of whom find themselves on battlefields in Syria defending dictator Bashar al-Assad. A consistent wave of Afghan migrants into Iran helps the country maintain military operations in other places it has helped destabilize, such as Iraq and Yemen.

The Trump administration is currently embroiled in a series of discussions with the Taliban to discuss a potential resolution to the 17-year-old war that would disarm but legitimize the Taliban as a political party.

Afghanistan’s Khaama news agency reported Wednesday that Ghani, who the Taliban have refused to cooperate with deeming him an illegitimate ruler of the country, discussed the “joint fight against terrorism” with Shamkhani, who spoke on behalf of the Iranian government.

“According to ARG Palace, the two side sheld talks regarding further expansion of bilateral ties between Kabul and Tehran, importance of regional consensus, Afghan-led and owned peace process, and joint fight against terrorism,” Khaama reported, noting that the meeting reportedly occurred on Wednesday evening local time.

Iran’s Tasnim News Agency adds to the Khaama report that Ghani’s government is reportedly aware that Iran is negotiating with the Taliban.

“The series of (Iran’s) connections and negotiations with the Taliban have been held with the knowledge of the Afghan government, and this process will proceed,” Shamkhani reportedly said at a meeting with senior Afghan officials Wednesday.

The Iranian state media outlet Mehr News also reported on Thursday that Iranian officials are in conversation with the Taliban.

Supreme National Security Council member Keyvan Khosravi is quoted in the article as stating that “talks with Taliban would continue and the Supreme National Security Council would make a public announcement in that regard in the near future.” He did not provide any details on the talks, but linked them to Shamkhani’s Kabul visit, while urging American troops to withdraw from Afghanistan.

Reuters notes that the Taliban and the Iranian government have reportedly long-held ties. “[I]n recent months Afghan officials have accused Tehran, which the United States says is trying to extend its influence in western Afghanistan, of providing the Taliban with money, weapons and explosives. Iran denies that,” the agency reports.

The Pentagon accused the Iranian regime of providing direct assistance to the Taliban in a report in late 2017.

“Iran provides some support to the Taliban and publicly justifies its relationship with the Taliban as a means to combat the spread of ISIS-K [Islamic State -Khorasan] in Afghanistan,” the report read. “Iran’s support to the Taliban undermines the Afghan Government’s credibility, adds to instability in the region, and complicates strategic partnership agreements.”

Iranian officials continue to insist that the presence of the Islamic State in Afghanistan poses a security threat to Iran that makes their involvement in the war there legitimate. Unlike the Taliban, which has on occasion neglected sectarian disagreements with Iran to reportedly accept funds and weapons, the Sunni Islamic State have targeted Iran as an even greater enemy than the Western world.

The group notably staged a terrorist attack in Tehran last year, attacking the tomb of the founder of the Iranian theocracy, Ayatollah Ruhollah Khomeini, and killing 12.

The Iranian regime has publicly insisted that the United States created and continues to fund the Islamic State. Following the Tehran attack, the Iranian Parliament erupted in a chant of “death to America!” in response to the ISIS killings.

Iran’s involvement in Syria has largely been in defense of the Assad regime against Sunni groups like the Free Syrian Army (FSA), some of which have ties to Sunni jihadist groups. Tehran insists that it has also fought the Islamic State in the area, however, and used Afghan refugees to prevent loss of Iranian life on the battlefield. According to one report, Iran’s Islamic Revolutionary Guard Corps (IRGC) used Afghans as “cannon fodder” on the front lines against Syrian rebel fighters.

Iran’s PressTV claimed on Thursday that the Pentagon supported Iran’s role in Afghanistan, citing its opposition to the Islamic State.

Follow Frances Martel on Facebook and Twitter.