Image copyright AP

Despite neighbouring some of the titans of international cricket, Afghanistan does not have a long tradition of its own in the sport. But now cricket, long neglected and viewed as a foreign import in Afghanistan, is gaining in popularity and helping unite the country, as the BBC's Jafar Haand explains.

Last October thousands of people turned out in cities across Afghanistan in jubilation to celebrate a sporting victory - not a victory in football, as they had had in September, but in cricket. It was the first time Afghanistan had ever qualified for the Cricket World Cup, to be held in Australia and New Zealand in 2015.

No mean feat for a country where cricket has not always been a popular sport and people are struggling with the legacy of decades of war. So how has Afghanistan been able to take its place at the sport's top table?

The answer, like much of Afghanistan's recent history, lies in the refugee camps established in Pakistan by Afghans fleeing the war against the Soviets in the 1980s.

When I started thinking about making a national team, I went to every Afghan player that I knew and encouraged them to come to Kabul Taj Malook, Former national coach

Unlike in other countries in South Asia, the British did not leave a strong legacy of cricket in Afghanistan. But I remember coming into contact with it as a child for the first time in the Jalozai camp near the Pakistani city of Peshawar.

In 1992, Pakistan won the Cricket World Cup and an already cricket-mad nation celebrated by taking to the game with a renewed fervour. In every street and every park in the country there was a cricket match going on - and before long, we in the camps were joining in too.

Karim Sadiq, one of the Afghan national team's opening batsmen, was also a child in one of the Pakistani camps, Kacha Kara, when he got the cricketing bug. He would work in a match factory by night and play cricket by day, such was the enthusiasm among the youth in the camps for the new game.

It was that sort of commitment that Taj Malook, the father of Afghan cricket, was looking for in the 1990s when he dreamt of setting up an Afghan national cricket team.

"We were living in Kacha Kara camp," Mr Malook remembers. "I was running an Afghan team playing alongside with my three brothers, we were crazy fans of cricket, following every international match.

"I was thinking that if we keep on playing cricket, we will have a national team representing our own country."

Mr Malook went between the different camps in Afghanistan looking for good players, and scouted for talent among Afghans who had made it into Pakistani teams.

But not everyone was as keen.

"When I started thinking about making a national team, I went to every Afghan player that I knew and encouraged them to come to Kabul. But their fathers came to our home and warned me not to do that. They told me that cricket kills the time of their sons," Mr Malook says.

Batsman Karim Sadiq has similar memories. "We did not even have money to eat, so I was under pressure from my family because I wasn't earning," he says.

Image copyright Getty Images Image caption More and more Afghans have been playing the game over the past ten years

Image copyright Getty Images Image caption As in neighbouring countries, any patch of free space can become a pitch

Image copyright Getty Images Image caption Young people inside Afghanistan have now started playing the game too

Image copyright AFP Image caption Plans are afoot to encourage more cricket in schools, and girls have also been able to participate

However, Mr Malook persevered and by 1995, the Afghan Cricket Federation had been established in Kabul under the auspices of the country's Olympic committee.

This was despite the rise of the Islamist Taliban movement, who had banned other sports being played in public.

But where footballers' shorts were deemed by the Taliban to be un-Islamic, the more modest cricket whites posed no such problem. Besides, many Taliban, who had also spent time in the camps in Pakistan, had also acquired a liking for the game.

I was even present at some matches where Taliban officials would hand out awards to the players.

I am very happy that we have raised our national flag in every part of the world, and showed a positive picture of our country Karim Sadiq, Opening batsman in the Afghan national team

Once the game had made it back to Afghanistan, it still faced many obstacles. After the US-led overthrow of the Taliban, Mr Malook appealed to the new government in Kabul for support for the fledgling cricket scene.

"They said to us: 'We won't give you any money for this, it's a foreign game'," Mr Malook remembers, saying the team had to turn to friends for funds.

Nevertheless, the sport has continued to grow in Afghanistan, with only a few provinces without active local teams.

The International Cricket Council is now helping provide resources, and more and more of the country's talent is being nurtured inside Afghanistan, as shown by the country's thriving youth teams.

Cricket first took root in the Pashtun-majority provinces bordering Pakistan, and it has a reputation as being a Pashtun sport in Afghanistan, but even this is changing, with members of many of Afghanistan's other communities now represented in the national team.

When the team had its crucial World Cup qualifier match, it wasn't just Pashtuns who were praying for an Afghan victory - all of us Afghans were.

And it wasn't just Pashtuns who were out celebrating and dancing in the streets after the victory - Hazaras, Uzbeks and Tajiks were too.

Mr Sadiq says he is proud that proud that "our victory and cricket brought happiness to our county" and that the sport has "changed his life totally".

"I am very happy that we have raised our national flag in every part of the world, and showed a positive picture of our country to the rest of world that Afghanistan is not just a country of war and drugs, it's a county of love and sports," he says.