It was while he was stopping for a cup of tea on the 24-hour drive from the central Afghan province of Bamiyan to Kabul that film-maker Phil Grabsky caught some unwanted local attention. "There was a whole bunch of guys standing around watching us. One of them looked at me and shouted something in my direction. I asked my translator what he'd said, but he wouldn't tell me. He just said, 'Right, we'd better leave now.' I kept pressing him to tell me. Turns out it was, 'If I had a knife, I'd slit the throat of that American right now.'"

Grabsky isn't American – he lives in Brighton – but he was an obvious outsider who, with his camera in tow, looked dubious enough to garner mistrust from bystanders. But he isn't a total stranger to Afghanistan. He has visited the country half a dozen times on extended trips in the past 10 years, filming a refugee Afghan family living in poverty in some of the most remote and rural areas of the country for his documentary The Boy Mir: Ten Years in Afghanistan.

The Boy Mir is the result of extraordinary persistence by Grabsky and his co-film-maker, Shoaib Sharifi, an Afghan national and BBC World Service journalist; they had to commit to visiting Afghanistan almost every year for a decade. The Boy Mir picks up where Grabsky's 2004 documentary about Afghanistan, The Boy Who Plays on the Buddhas of Bamiyan, left off. It follows the life of the same young Hazara boy from the age of eight to roughly 18 (no one knows his exact age). The film observes the hardships Mir and his family face trying to survive: he sleeps in rubble, ploughs barren land with malnourished donkeys and skips school to work in treacherous coal mines to earn four dollars for every truck filled.

Mir in June 2009.

But how exactly did a western outsider manage to travel routinely to film in one of the most turbulent and dangerous countries in the world? "It was difficult and, yes, a little scary," says Grabsky. "The first trip in 2002 was the most challenging. It was just after the fall of the Taliban and I had two young children. I called my wife whenever I could. I had to have medical training about what to do if I stepped on a mine. Stepping on a mine became one of my biggest fears. That, and also wondering whether the authorities would beat me up and throw me in jail for having a camera."

No one did beat Grabsky up, nor did the authorities stop him, though there were tense moments, such as driving through an armed Taliban roadblock in the dead of night – "You just don't drive at night, you just don't" – and being mistaken for a local warlord whom villagers wanted dead.

Grabsky paid for much of the filming with his own money, but Channel 4, which also helped fund it, put strict security procedures in place, including arranging a meeting with Karim Khalili, now the second vice-president of Afghanistan and a Hazara warlord, who gave Grabsky and Sharifi the permission they needed to film. "The only thing Khalili prevented us from doing was sleeping in a cave. He couldn't guarantee our safety if we did."

Filming for at least 12 hours a day, Grabsky and Sharifi slept rough on the floor of the local village school. Sharifi did break the rules once and spent a night in a cave with Mir and his brother-in-law Khushdel, resulting in one of the film's funnier scenes as the pair mess around competing to down their cups of tea. Staying with Mir's family in their home would have made things awkward for the family, and Grabsky says his priority was to make sure the family wasn't put in a difficult position.

"Everyone was impoverished – and there was me, giving all this attention to just one family. I had to be very careful and make sure the community as a whole felt like they were being given attention, not just Mir's family." At the end of every trip, Grabsky and Sharifi made donations to the village, such as providing the local school with tables and chairs and money to buy a roof.

When travelling alone, Sharifi sometimes stayed in the family hut, making sure none of the other villagers saw him there. "When I stayed, Mir's mother and sister would sleep in the kitchen, which made me feel really bad. But at the same time, for the sake of filming, I had to." His presence clearly made filming easier. Fluent in Dari, the local Hazara dialect, he was able to communicate and bond with Mir's family (Mir calls him "big brother"), which in turn made them oblivious to the fact a camera was watching them.

The result is some startlingly personal footage. Mir's parents bicker brutally about chores and money; there are emotional family discussions about Mir's future, as his father and brother-in-law urge him to get an education so as not to end up like them. The family's only request to limit filming was to ask that their daughter, Mir's sister, remain off camera (she appears only fleetingly). Other than that, Sharifi and Grabsky had full access to the family's life.

"This isn't acting," says Sharifi. "We weren't asking them to do anything; we were just watching them. Once we explained the film wasn't going to ruin the family's reputation, they were very comfortable. It didn't feel like 'filming' – we would just sit in the background and watch."

In the film, the family's hardship is brutal and they survive on scant meals of cow's stomach, tea and stale bread. With such obvious poverty, did Grabsky and Sharifi ever fear their presence was a burden? "We always brought our own food precisely so as not to burden anyone," says Grabsky. "We shared whatever we had – my camera bag was full of cereal bars that always got passed around. It was a humbling experience. Sometimes, they'd have so little tea that they'd only make it for us, and for us to refuse would have been considered rude. We'd drive to the city and take Mir and Khushdel to a kebab shop. They would just eat and eat."

The village where the family lives isn't named in the film, which seems a notable omission. But there's a reason for it. "I once had a Hollywood casting agent call; she wanted to screen-test Mir to play the role of the local Hazara boy in The Kite Runner," says Grabsky. "But I had to put Mir first. I've read the book, I knew about the rape scene and it's inappropriate for Mir. So we just don't say where he lives because it's not in Mir's best interests."

For safety reasons, the filming trips were sporadic, dependent on what the political situation was like. The family never knew when Grabsky and Sharifi might turn up, and the pair weren't allowed to tell them when they were leaving. "I didn't feel the danger, but I knew that if people knew when we were leaving, it heightened the risk of kidnapping," says Sharifi. "It was a complete surprise for them when we'd turn up and then one day we'd just have to go."

Grabsky intended to visit Afghanistan this year to show The Boy Mir to the family, but his trip was cancelled after an explosion killed 14 people in Mazar-e-Sharif (the closest city to Mir's village) just before he was due to leave. The road from Kabul to Mir's village has become dangerous; a governor was beheaded there and there have been kidnappings en route. On Grabsky's last trip to Afghanistan, Sharifi advised him to wear Afghan clothes, and he attempted to grow a beard.

Grabsky says the film has taken on a moral dimension for the film-makers. He has set up a fund for Mir, and Sharifi opened a bank account for the family. When Sharifi last saw him, Mir had left school and was trying to provide for his family. "It's sad but there's very little you can do to advise a rural boy about his options," says Sharifi. "His life is determined by geography and nature. If it rains, he can go to school, because it means there'll be a good harvest. If it doesn't, then he has to prepare himself for a harsh winter – and that means no school."

But Grabsky remains hopeful that the film, and any donations audiences might make to Mir's fund, might still change Mir's life. "The moment I started filming, I interfered with Mir's life. Now I have a duty of care towards him. I just hope he gets the opportunities he deserves."

The Boy Mir: Ten Years in Afghanistan premieres on 28 September at the Royal Geographical Society, London, and is released on 30 September. Screening details: theboymir.com