When filming a drama about a white schoolgirl who embraces Islam, producers went to considerable lengths to win over the local Muslim community.

It's with some trepidation that I approach the set of White Girl, a drama based in Bradford that explores Islam and forms the centrepiece of BBC2's forthcoming White season. After all, the drama has apparently caused “fury” in the local community, according to campaigning group Just West Yorkshire. Am I about to enter a hotbed of racial and religious tension?

The answer to this question is a resounding “no”. In fact, the atmosphere on location is more street party than battle zone. Two old men, speaking Punjabi, have pulled their garden chairs onto the pavement to get a better view of the filming as they while away the afternoon. The crew say they have been permanent fixtures since day one, as have the young Asian kids whizzing past on their bikes and their matronly mothers who are constantly offering up tea and dinner. It's hard to distinguish the crew from the local residents.

Relationship-building has been key to the success of filming, says location manager Charlie Thompson. Much groundwork was necessary to reassure locals fed up with the stereotyping of Bradford as a hub of religious extremism. A one-page leaflet was distributed in the community, outlining the storyline written by acclaimed British talent Abi Morgan.

It explained that the 90-minute film is about a white family, a mother and her three kids who leave their high-rise home in Leeds, and their violent husband/father, and are relocated to an all-Muslim area of Bradford. They suddenly feel like outsiders in their own home. But for one of the children, 11-year-old Leah, the colour, vibrancy and romance of Islam prove intoxicating and, by the end of the film, she has converted to the religion and is wearing a hijab.

Although the story presents a positive image of Islam, the community was still wary of any filming in their area. This is understandable given that previous films have focused on the Bradford riots or portrayed the area as a breeding ground for extremists. “It takes a lot of effort to bring a community on side that has largely been portrayed in a negative way,” says Thompson.

The first step in this eight-week preparation process was approaching community associations such as Bradford City Council, Screen Yorkshire and the Council for Mosques. These groups were quick to see the project as an opportunity to change perceptions and the crew was put in touch with community liaison officer Asif Khan. Khan accompanied the crew knocking on doors to introduce themselves and acted as a translator, as many locals don't speak English.

“The Council for Mosques in Bradford recommended that I work with them,” says Khan. “They're usually quite good at media, so I trust them. I was confident that if they recommended it, the film has to be okay. But if it turns out to be a negative programme, I'll be a dead man around here.” As part of its efforts to build relationships, the crew tried where possible to employ local people as extras and security guards, as well as offering three traineeships to local young people.

One of the trainees is Sajd Shah, who lives near the film site. “I want to be a voice for people round here, to show that it doesn't matter what background you come from, you can work in television. A lot of people from this area wouldn't go into TV because it's traditional to become a housewife, doctor, solicitor or professional. Nobody thinks that this industry suits those from an Asian background,” she says.

All this work behind the scenes paid off. Producer Andrew Woodhead was blissfully unaware of the tensions before filming. “We've felt completely safe here,” says Woodhead. “What you see here, and in the film, is that most people just get on with their lives and don't want any part of extremism. Being here has been easy. People just want to help,” he says.

When I visit the set, the crew is filming a scene in Leah's small yard, which backs onto a communal alleyway. One reason this location was chosen was because the cramped, terraced house is at the top of this alley with a view over the rest of Bradford.

The actress who plays Leah - newcomer Holly Kenny - is filming a scene in pyjamas and her piercing eyes convey better than any words the turmoil her character is experiencing. In fact, she outshines all the cast, including Anna Maxwell Martin, who won a Bafta for her performance in Bleak House and who plays Leah's mother.

For BBC executive producer Lucy Richer the casting of Leah presented the biggest challenge because the story is told through her eyes and her performance is fundamental to the film's effectiveness. “The casting of Holly was the decision I was most frightened of and also most pleased with afterwards. A 90-minute film for TV doesn't give you much room for error so we needed top performances, especially from Holly.”

Richer, however, cites two other factors which she believes will make this film a success: the script and the direction. “Abi is one of the foremost writers of her generation and has this ability to bring a story to life. Director Hetty MacDonald has realised [the story] fantastically well in her filming. She has managed to find a way to convey realism, which is underpinned by a poetry in her direction. She's also captured the fact that, although Leah has been robbed of her childhood, she is still a child and still sees the world as a child.”

The film combines a cinematic, British feel by nakedly depicting the harsh realities of life for a poverty-stricken white family struggling with drink, drugs and domestic violence with a lyrical quality. You're struck by stark contrasts symbolising the difference between the white and Asian families: the former's wallpaper is drab and damp and hanging off the wall whereas the latter's house is full of colour, sounds and freshly cooked meals. The Asian parents, particularly the father, have a soothing gentleness about them which Leah is drawn to, in contrast to the aggression of her stepdad, Stevie. But despite all the unattractive traits of the white family, Morgan hopes audiences feel a growing sympathy with them, too, even Stevie: “I'm really fond of them. They're just dysfunctional, like we all are sometimes.”

At its heart, says Morgan, “White Girl is a love story between a mother and a daughter. It's about the coming of age of two women. It's not about Islam. It's not about race.” For that reason, there's a sense that both Morgan and Richer feel its inclusion in BBC2's White season is unhelpful, but presumably this decision was not theirs. “I didn't write it with a season in mind,” says Morgan. “In many ways seasons can be useful or they can put a set of expectations on a piece. It's great to be part of a season but I feel the piece stands on its own as well.”

Richer agrees: “BBC2 decided to use it as the centrepiece to its White season and it's very different from the other programmes in the season, which are all factual. I would personally prefer it to be a standalone drama and to speak for itself but playing a drama in a season provides variety to the range.”

There's a feeling among the crew that the controversy stirred up by the season is unhelpful too because it deflects from the true story. “We never set out to do it as a film about social issues, to project some kind of polemic,” says Brenman.

Nevertheless, Morgan concedes that the subject matter was always going to make a good headline. “Yes I expect the white family to cause more controversy,” she says. “If you're a writer, you put yourself out there and you've got to expect criticism. You don't know how something is going to be received. And that moment can sometimes only happen when you're there, watching it with an audience.”

White Girl
Broadcaster: BBC2
Producer: Tiger Aspect
Start: Monday 10 March at 9pm as part of BBC2's White season. Other programmes in the season are Last Orders, Rivers of Blood, The Primary, The Poles Are Coming and All White in Barking
Director: Hetty MacDonald
Producer: Andrew Woodhead
Executive producer: Greg Brenman
Executive producer, BBC: Lucy Richer
Screenplay: Abi Morgan
DoP: Wojciech Szepel

Q&A: Abi Morgan

Credits: My Fragile Heart, Murder, Tsunami - The Aftermath, Sex Traffic (which won best drama serial at the Baftas and the RTS).
Adaptations include Brick Lane, Birdsong, If The Spirit Moves You and On Beauty.
Age: 39
Lives: London

What inspired you to write White Girl?
I was approached by Tiger Aspect to write a script inspired by the Channel 4 documentary The Last White Kids, which looked at families living in an area of Bradford. There was a girl in the documentary who was on the edge of puberty and who converted to Islam. At a time when Islam and being Muslim have been vilified, it felt like an opportunity to explore the other side of the story through the eyes of a young girl. But, apart from getting the idea from the documentary, the whole script is fictional rather than based on that particular girl's story.

How long did the script take to write?
It had a slow gestation. I started it a good three years ago, and have worked on it in between different projects. After the 7 July bombings wasn't the most obvious time to do it, so that probably delayed the project a bit.

How did you approach writing it?
I always try and find a central theme that will grab audiences. For White Girl it's Leah's relationship with her mother.

What's your favourite scene?
A key moment is when Leah describes to her mum how she feels going into the mosque. It shows two women at very different stages in their lives, coming to some understanding. I also like the breakfast scene at the end.

Did you have to do many redrafts?
Yes. We had to make several cuts. For example, the neighbouring Asian family originally had a more wayward brother who had a more Western lifestyle, but we stripped that back because there wasn't room.

Is the film what you imagined it would be?
It has been beautifully shot and Hetty has brought a really simple poetry to the piece, reflected in her style of photography.

Is the fact you chose Islam as a religion incidental?
I chose Islam because it's the fastest-growing religion at the moment. But this is a piece about faith. Leah could just have easily been drawn to Judaism.

What are your hopes for White Girl?
That audiences are absorbed and don't switch channels! I hope they spend 90 minutes watching it.