Iran is covertly recruiting hundreds of Afghan Shias in Afghanistan to fight for Syrian president Bashar al-Assad, drawing them out of their own conflict-ridden country and into another war in which Afghanistan plays no official part.

The Afghan fighters are often impoverished, religiously devout or ostracised from society, looking for money, social acceptance and a sense of purpose that they are unable to find at home.

Iran’s recruitment of Afghan migrants and refugees within its own borders has been documented. But similar Iranian activities inside Afghanistan had previously gone unreported.

Iran denies using “any kind of allurement or coercion”, or to otherwise recruiting Afghans to fight in Syria, according to an embassy spokesman in Kabul. But a Guardian investigation can reveal both how Iran coaxes Afghan men into war, and the motives that prompt these men to travel thousands of miles to join a battle they might not return from.

Central in this recruitment are men such as Jawad. A police officer by day and self-declared “travel agent” when off-duty, Jawad said he acted for a year as middleman for Iran’s Revolutionary Guard (IRGC) when in 2014 it formed an Afghan Shia militia, the Fatemiyoun Division, to fight alongside Syrian government forces.

From his “travel agency” on the second floor of a non-descript office building, Jawad connected combat willing men with Iran’s embassy in Kabul. The embassy assisted with visas and travel, and paid Jawad a commission for his troubles.

In return for fighting, Afghans are offered a residence permit in Iran and about $500 monthly salary. “Most go to Syria for the money,” said Jawad, wearing stonewashed jeans and replica Ray-Bans. “Others go to defend the shrine.”

A Syrian soldier in the Jobar area of Damascus, Syria. Photograph: AP

Syria is home to several holy Shia sites, above all the Sayyidah Zaynab mosque in Damascus, which honours the Prophet Muhammad’s granddaughter, and which has been a rallying point for Shias who want to defend it from Sunni militants such as Islamic State.

The first time the Guardian met Jawad, he was preparing to travel to Syria himself. Isis had abducted 12 Afghan fighters in a suburb of Damascus. It was Jawad who had recruited them, and their families now demanded that he help secure their release, he said.

When he returned from Syria a month later, he was clearly shaken. Showing photos from Damascus, he said he had negotiated the hostages’ freedom, but also seen first hand how “the Iranians use Afghans as human shields”. He said he would stop working as go-between for the Iranians. “I’m ashamed because I sent these people,” he said.

There might be another reason for Jawad’s change of heart. Upon his return, the Afghan intelligence agency, NDS, arrested Jawad for 48 hours. “They told me, ‘don’t sell your brothers to another country’,” he said.

With no available official figures, estimates of how many Afghans are fighting in Syria vary wildly. Iranian state media, while not acknowledging direct Iranian involvement, say 20,000 Afghans are fighting in Syria.

According to Amir Toumaj, a researcher with the Foundation for Defense of Democracies, the Fatemiyoun was recently upgraded from a brigade to a division, which normally numbers over 10,000.

Others think those numbers are exaggerated. Ali Alfoneh, an independent Iran analyst based in Washington, DC, put the number of Afghans fighting in Syria at a couple of thousand. At least 334 Afghan Shias have been killed in combat in Syria since September 2013, he added.

A new Iranian law allows the government to grant citizenship to families of Afghans slain in the Syria war. The law is likely an attempt to encourage them to take on more risky missions, and attract recruits, said Toumaj.

For Iran, having a loyal Afghan militia may serve a longer-term purpose beyond Syria. “It clearly serves the interests of the IRGC to train Shia Afghans who later can fight the Taliban or other Sunni groups on Afghan soil after United States military withdrawal from that country,” Alfoneh said.

Once in Syria, Afghans are often in the first line of offensive action. One fighter, Mohammad, 19, remembered entering a hospital occupied by enemy combatants.

“To scare us, they threw human heads at us. The head of a small child fell on my foot. My shoes got bloodied, and I really got scared,” he said over the phone from Tehran where he had recently returned. “I entered a building and my foot touched a wire and triggered an explosion. 12 pieces of shrapnel hit my legs and my hand.”

Assessing the number of Afghan fighters is complicated further by the fact that casualties’ bodies are rarely returned home for burial. In addition, some pretend they are moving to Iran, before disappearing.

Funeral ceremonies in Mashhad, Iran, for Afghan militiamen killed in Syria. Photograph: FDD

Ehsan and Fahim were two friends from Mazar-e Sharif, who each told their ageing parents they were headed to Tehran for work.

Not long after their departure, Ehasn began sending Facebook messages and photos from Syria to a third friend, Rasool.

“He was a very religious person. He always talked about how it was his religious duty to go to Syria,” said Rasool.

In early May, shortly after 80 pro-government combatants – including dozens of Afghans – were killed in a battle for Khan Touman, near Aleppo, Ehsan sent Rasool a Facebook message but there was no word from Fahim. At their wit’s end, his parents resolved to go to Iran. They are still searching for him.

Some Afghan politicians have tried to intervene. Nazir Ahmadzai, an MP who has tracked recruitment of Afghan combatants, said Iran was stoking ethnic tension between Sunnis and Shias, in order to assert control in Afghanistan.

“Iran’s policy is to bring division between Muslims. They want Afghanistan to become like Syria,” he said, adding that he had seen a list of at least 1,800 Afghans recruited in Kabul alone. Analysts, though, like Alfoneh, rejected that estimate as too high.

In addition to agents like Jawad, the IRGC has also allegedly used mosques in Afghan cities as recruitment grounds. One such mosque is in Dast-e Barchi, a predominantly Shia neighbourhood in Kabul, according to Ahmadzai who declined to name the mosque. He said after he dispatched a team of investigators, the mosque ceased recruitment.

Although the Iranian embassy in Kabul denied involvement, a Syrian opposition leader fighting the Fatemiyoun recently urged the Afghan government to stop the flow of fighters traveling to Syria. Haitham Maleh, a member of the Syrian National Coalition, put the number of Afghans fighting in pro-Assad forces at 8,000.

The Afghan intelligence service has clamped down on some recruitment, but it treads carefully, said Ali Mohammad Ali, a security analyst.

As more actors became involved in Syria, the the situation has only become more complicated. Because relations with its other powerful neighbour, Pakistan, are unusually acrimonious, Kabul cannot afford to antagonise Tehran as well, Ali said.

An attack on a tunnel used by forces loyal to President Assad in the village of Foua, Idlib. Photograph: Omar Haj Kadour/AFP/Getty Images

For Mohsen, 24, the war in Syria was a chance to fight for the right cause. It was during a battle with Islamic State fighters outside Aleppo that he says he saw proof that God was on his side.

Fighting had raged nonstop for 24 hours. Exhausted, Mohsen leaned his head back against a wall so his helmet tipped forward. In that moment, a bullet pierced the front of his helmet, barely missing his forehead, on which he had written “Ya, Bibi Zaynab!” in salute to the Prophet Muhammad’s granddaughter. He survived, and days later helped his company liberate Nubl and Zahra, two Shia villages that had been under Isis siege for four years.

“My aim was to defend innocent Shias in Syria,” Mohsen told the Guardian. “Isis show no mercy. They kill children, old people, everybody.”

In a Kabul teahouse, Mohsen – who was recruited in Iran – showed phone photos of himself in Syria, wearing fatigues and painted with kohl around the eyes. During his third and most recent trip to Syria, in February, he was injured three times. One bullet was still lodged in his thigh. He carried the other one as a necklace.

“I’m not doing anything wrong. The holy places belong to us. We’re going to defend them,” he said.

Despite opposition from family, intelligence and politicians, young Afghans will likely continue to drift toward Syria, as long as hopes of a safe, prosperous future at home remain dim.

“People who go leave nothing behind, they have lost all hope,” said Younis, an unemployed university graduate in Kabul who knows 20 people that went to Syria from Iran, including two cousins and an uncle who were killed. All were addicts or had deep family problems, he said.

Facing discrimination, drug abuse, and the stigma that comes with it, some see war as the only way to do something out of their own volition. Going to Syria is the ultimate act of desperation, Younis said.

“They either die and become martyrs, or they will get a better life,” with salary and residency in Iran, he said. “They want a fresh start.”

*Some names have been changed to protect identities of sources.