A secret pitch where girls can play football away from the disapproving gaze of religious leaders and the rise of a top female football referee are among the unlikely success stories emerging from a refugee camp in north Lebanon.

Under the aegis of a project to encourage learning through sport, Nahr el-Bared, a camp where thousands of Palestinian and Syrian refugees continue to live hand-to-mouth in dire conditions, has become the improbable setting for a minor cultural revolution.

Change was set in motion after religious leaders in the community attempted to prevent girls from playing football and ban female coaches at an education centre supported by the global charity Right To Play.

“One day, during Friday prayer, the religious people said: ‘We have female coaches in the camp, teaching people how to play football. We can’t allow this, it can’t happen. Girls cannot play football’. So they took away the players from our coaches and assigned a male coach instead,” says Sarah El Jizi, head coach in the Beirut area for Right To Play’s sports and humanitarian assistance project.

“They were worried because the girls were wearing shorts – by shorts, I mean long shorts – and shirts with half sleeves. They were not comfortable with the girls wearing these uniforms and playing in front of everyone.”

An education centre in Nahr el-Bared refugee camp. An artificial grass football pitch was built in a space behind the building. Photograph: Courtesy of Right To Play

The unlikely solution was to build a wall. Or rather, build behind a wall. “There was a space at the back of an education centre,” explains El Jizi. “So Right To Play renovated it and built a football pitch for the female players to play without being seen by the community.

“The female coaches kept on convincing the players and their parents to continue the training, and now they have more girls participating than before and can play freely.”

Shielded from public view, the girls are cheered on from the sidelines by male family members and friends. There are also mixed games, used by the coaches to foster female leadership and a wider spirit of inclusion. In one such activity, called girls score, female team captains are nominated and tasked with choosing team-mates – and monopolising the scoresheet.

“Only girls can score the goals,” explains Nimtaz-Tanya Noordin, Right To Play’s senior UK communications manager. “This puts girls at the heart of the team and gives them confidence. Importantly, it ensures boys pass the ball to the girls and see them as equal.

Hidden from public view, girls and boys watch a game of football in Nahr el-Bared refugee camp. Photograph: Courtesy of Right To Play

“By involving boys… we are sowing the seeds of long-term social change to overcome the deep-rooted discrimination and attitudes that persistently disadvantage girls and women.”

The battle is far from won. Girls may now able to play football in one sequestered corner of Nahr el-Bared, but women remain prohibited, their participation limited to occasional tournaments staged outside the camp by Right To Play.

Slowly, though, attitudes are changing – not least among the girls themselves. “They are becoming more confident,” says El Jizi. “It’s changing their lives and how they interact with their neighbours, families, brothers, sisters.”

It is also transforming their prospects. One girl, Latifa Kilani – “she is better than all the boys,” says El Jizi – now plays for the national under-16 women’s team. Another, Sanaa el Cheikh, has opened up her own football academy in Quobbeh, Tripoli, enabling her to support her brother and sister following the death of her parents. She was recently selected as a coach for Ansar Al Mawada Sports Club, a third division men’s team in Tripoli – a rare precedent.

Such achievements would once have been unthinkable for anyone from Nahr el-Bared. Twelve years ago, the camp was razed to the ground in a conflict between Lebanese security forces and Islamist militants. In the aftermath, the UN Relief and Works Agency declared it the scene of a “chronic humanitarian crisis”. The reconstruction effort that followed was the largest project ever mounted by the organisation.

‘Without Right To Play I wouldn’t be where I am today’: Zeinab Halabi. Photograph: Courtesy of Right To Play

Although a funding shortfall of $66m (£54m) remains, significant progress has been made. Of the 27,000 residents forced to leave in 2007, the majority have returned to the camp. However, an estimated 7,137 people – 1,600 families – are still waiting. “The majority of these are renting private accommodation or living in temporary shelters, many of which are in extremely poor condition,” said a UN spokesman.

El Jizi paints a bleak picture of life in the camp: “The refugees experience poverty and their electricity keeps cutting off; they don’t have safe spaces and there is no access to public facilities.”

Football pales into insignificance in such circumstances. But if day-to-day survival remains the imperative for many in Nahr el-Bared, Zeinab Halabi, from Lebanon, who started as a volunteer with Right To Play three years ago, is living proof of the shaping influence that sport can have on the fortunes of girls and women.

‘I always support the girls’: Zeinab Halabi. Photograph: Courtesy of Right To Play

“Without Right To Play I wouldn’t be where I am today,” says Halabi, 28, a former kickboxer who once claimed the title of strongest Arab woman in a weightlifting competition. “I take self-confidence from sport.”

In a country where female football coaches are few and far between at any level, Halabi has managed Montada North Lebanon, a Lebanese Women’s Football League side, and is currently match commissioner for the men’s first division, a role no woman has previously held. But it is her decision to divorce her husband over his refusal to let her be involved in football that has given her a measure of fame.

A kickboxer who became her coach and then her spouse, Halabi’s former husband asked her to turn her back on the game soon after they were married. “He asked me to stop, even though I had a girl’s team and not a men’s,” she recounts.

“He said: ‘You have to stay in and wait for me to come home and cook and clean.’ So I told him: ‘I’m not a slave, I have my own world and you told me you respect that. I have my own life, and it’s about football. It’s your world and my world – we cannot stay together.’”

The subsequent parting was acrimonious, with Halabi threatening to call the police on her husband when he turned up to a training session and became abusive. But she takes pride in her actions and has become a role model for young girls in Nahr el-Bared.

“I always support the girls and tell them that they can do what I’m doing today,” says Halabi. “I tell them: ‘If you want to be like me – and you can be better than me – you have to do sport and, in time, you can find what you want.”