WASHINGTON (Reuters) - Western intermediaries are trying to persuade arch foes Iran and the United States to cooperate on bolstering security in Afghanistan as U.S. President Donald Trump seeks to extract America from its longest war, according to three source familiar with the efforts.

The intermediaries, the sources say, secretly have been relaying messages between Washington and Tehran for months in hopes of getting the sides talking at a time of heightened hostility on a range of issues.

“Afghanistan is one area where there is common ground,” one source with knowledge of the correspondence told Reuters, speaking on condition of anonymity.

The White House declined to comment and the U.S. State Department did not respond to requests for comment.

Iran officially denies any back channel talks with the United States over any topic.

The United States and Iran share an interest in ensuring that a departure of the more than 20,000 U.S.-led foreign troops does not plunge Afghanistan into a civil war that restores the Taliban’s harsh version of Islamic rule, and does not allow al Qaeda or other Sunni Muslim extremist groups to expand there.

Moreover, with U.S. sanctions hammering its economy, Tehran wants to avoid Afghans fleeing to neighboring Iran if there was a surge in bloodletting, regional experts said, as has happened over decades of war in the central Asian country.

Trump and Tehran have another shared interest: Both want U.S. troops out of Afghanistan.

There are no signs, however, that either Tehran or Washington are ready to put aside disputes over Iran’s nuclear program and U.S. and Iranian activities and alliances in the Mideast to cooperate on Afghanistan.

FILE PHOTO: An Afghan policeman keeps watch at a hilltop in Kabul, Afghanistan July 23, 2019.REUTERS/Omar Sobhani/File Photo

One message seen by Reuters and conveyed to Washington outlined Iran’s concerns with the Trump administration’s negotiations with the Taliban on a U.S. troop withdrawal and intra-Afghan talks on a political settlement.

Afghan-born veteran U.S. diplomat Zalmay Khalilzad has erred in taking “over-zealous shortcuts by talking directly to the Taliban,” a senior Iranian official said in the message.

This approach has given “political supremacy” to the Taliban as they are gaining militarily, the message said. Taliban leaders, it continued, have told their Iranian interlocutors they will not “accept anything less than a Taliban-dominated government” that rules “an Islamic emirate.”

Shi’ite Muslim-dominated Iran long has been wary of the Sunni Muslim Taliban. It nearly went to war during Taliban rule when the militants killed at least eight Iranian diplomats and an Iranian journalist in 1998.

BACK CHANNEL

Direct contact between Iran and the United States would be a stark contrast to the tensions that took them to the brink of military confrontation after Iran downed an unmanned U.S. drone in the Gulf in June and Trump then halted a retaliatory air strike on Iran’s coast.

While Iran is open to talks, it wants at the very least a suspension of U.S. sanctions designed to slash its oil exports to zero, Tehran’s main source of income, according to two sources familiar with the U.S. and Iranian positions.

Iranian officials believe that a new peace process should be devised in which the Afghan government - which has been excluded from the U.S.-Taliban talks in Qatar - played a “dominant” role, the message said.

Several back-channel efforts, the sources said, are driven by a hope that cooperation on Afghanistan could lead to negotiations to lower the tensions ignited when Trump pulled the United States out of the 2015 international agreement designed to prevent Iran from developing a nuclear weapon in exchange for sanctions relief.

But one source familiar with the U.S. and Iranian positions said as far as Iran was concerned, if Washington acknowledged common interests in Afghanistan “and is willing to talk to Iran on the basis of equality about those common interests, then Iran will talk to the United States.” Now all Iran is getting from the United States is that they have no common interests, the source added.

U.S. Secretary of State Mike Pompeo and national security adviser John Bolton oppose any sanctions relief for Iran and were opposed to any talks on Afghanistan, believing Tehran will give in to U.S. demands, one of the sources said, who asked not to be identified. The U.S. State Department declined comment.

One former Afghan official pointed out that since the 2001 U.S.-led invasion to oust the Taliban government, Iran has built ties to the Taliban that it could use to help shape a peace settlement and a U.S. troop withdrawal.

Iran “could be very valuable,” said Ali Jalali, who served as Afghanistan’s first post-Taliban interior minister. “This is a very good opportunity for Iran.”

Tehran maintains high-level Taliban contacts and is a haven for some insurgent families. It has supplied limited quantities of weapons to the insurgents to keep pressure on U.S. forces near its border, according to Western officials.

Pompeo has accused Iran of being a “co-conspirator” of the Taliban. But some regional experts counter that Tehran is hedging its bets in case the militants return to power. It also sees the Taliban as a counter force to Islamic State’s Afghan affiliate.

Tehran also wields influence in Kabul, having backed Afghan governments for nearly two decades.

Iran maintains close ties with the Shi’ite Hazaras, Afghanistan’s third largest ethnic group, and strongmen of other ethnic minorities.

Washington and Tehran, regional experts said, also share the goal of preventing Afghanistan from reverting to a base of Sunni Muslim extremist groups, especially an affiliate of Islamic State, whose avowed enemies include the United States and Iran.

Whether Iran can play a meaningful role in any peace effort, or that Washington would allow it to do so, is an open question, said Ryan Crocker, a former U.S. ambassador to Kabul.

“I’m pretty skeptical that they (the intermediaries) will get any traction ... because of the policy this administration has developed on Iran. I’m afraid that ship has sailed.”