YAKAWLANG, Afghanistan — Iran has trained and deployed thousands of Shiite Afghans as shock troops in Syria’s sectarian war. Members of the Afghan unit, the Fatemiyoun Division, wear a shoulder patch recounting words of praise from Iran’s supreme leader as a badge of honor.

What those fighters might do when they come home is now very much on the minds of officials who fear that Afghanistan may become the next great sectarian battleground between Iran, as the declared guardian of Shiites, and Saudi Arabia, long the sponsor of conservative Sunni doctrine around the world.

“This is quite dangerous: What happens to this Fatemiyoun force when the war in Syria is over?” said Rahmatullah Nabil, a former Afghan intelligence chief. “The fear is that rivalry in the region, between Iran and Saudi, will shift to Afghanistan. And I think that clash is already shifting here.”

There is reason for worry. First, there’s a history: The factional divisions that drove Afghanistan’s devastating civil war in the 1990s were seized on by foreign powers who were seeking proxies. And there’s a new concern: A stark increase in attacks against Afghanistan’s Shiite minority, mostly by Sunni extremists loyal to the Islamic State, is already providing Iran a pretext to increase its meddling in the country.