Azra Jafari has won respect in her community as she fights to improve lives and change attitudes towards women

When Azra Jafari became mayor of Nili, she knew that the impoverished and remote Afghan town desperately needed roads and investment. She was aware she would be living in very basic conditions, on a meagre salary of $76 (£50) a month, and that taking care of a four-year-old daughter at the same time would be challenging.

What she was less prepared for was the appearance of a powerful mullah in her unheated, makeshift office, wagging his finger at her, warning that Nili was not about to accept a female mayor who thought she could "exploit her femininity in order to complete a few projects and influence our women".

"After three months, the same man came up to me and thanked me," Jafari recalled, four years later. "He said, 'If a man could do just half of what you've done here, our province will surely flourish.' He now supports me and we work very well together – I have a great deal of respect for him."

She is now referred to as "Mr Mayor" by her community, a title that conveys respect in a country not known for women's rights.

Until 2009, Nili – a small town of about 40,000 people at the centre of Daykundi province – had never seen a female official, said Jafari. She had to prove to the community that she was serious about improving their lives.

Jafari was shocked by the complete lack of infrastructure in the town. "Anything that needed to be built in Nili, had to be built from scratch," she said. "And I had no budget" – something she had to address by making regular trips to Kabul to implore ministry officials to release funds. "When I arrived, my office had been damaged by snowfall. It was a small room, with a few pillows. There was no table, no chairs. Just a couple of people there to help me," Jafari said.

"Wherever it was necessary I picked up a shovel, kicked dirt, and gathered coal with my hands. Nili is not the sort of town where you can easily drive a car. I often had to walk from place to place through deep snow, getting my feet soaking wet."

Location of Nili in Afghanistan.

The 34-year-old cannot be further from the image of the downtrodden victim that has become a misleading shorthand for Afghan womanhood. Nor is she connected to a powerful or wealthy family, and she fiercely rejects the suggestion that her promotion was an exercise in tokenism by a government under pressure from its western financiers to show it is bettering women's rights.

"If our friends in the international community really made me mayor because I am a woman then they would have paid for the roads I built. Unfortunately they have contributed very little to the changes in Daykundi," she said.

Jafari also does not hold back on the subject of how severely women in office in Afghanistan are judged, likening it to having one's decisions and behaviour placed under a magnifying glass.

"There are plenty of men here with no ambition to work, who are bad at their jobs and over whom a lot of money has been wasted. Because they are men, no one really questions them and asks 'as a man, how successful have you managed to be?' But as the only female mayor among 180 others, the first question I'm always asked, wherever I am, is 'show us what you've done for your people.'"

Jafari, who is married to an Afghan film-maker, is currently the subject of a documentary series called Afghanistan at Work, a sequel to Kabul: A City at Work, which seeks to show ordinary working Afghans doing extraordinary things at a time of war.

"Mr Mayor" grew up in Ghor province, which borders Daykundi to the west. Like Daykundi, Ghor's population is poor and mainly Shia Hazara. Jafari says that her familiarity with the people and their needs is what partly drew her to the job in Nili.

Daykundi has virtually no western troops. It was carved out of inhospitable mountainous terrain in the centre of Afghanistan in 2004, hugged by the much more restive provinces of Ghazni, Uruzgan and Helmand.

It takes Jafari and her daughter, Indira, two days to drive to Nili from Kabul. It is a perilous journey on poorly paved roads. It becomes a death trap during winter's heavy snowfall.

Two days after this interview, Jafari telephoned from Nili to explain that the small coach in which she had been travelling along with her daughter and 13 other passengers, had overturned and almost careered 1,600ft towards a riverbed below.

"The windows were shattered. Thank God we were OK," she said, adding that she had suffered a sprained neck and her daughter had cut her finger on some glass. "But she couldn't stop shaking for half an hour afterwards."

Bad weather and heart-stopping bus journeys are one risk. The other is the war being waged between Afghan and foreign forces and insurgents.

Jafari's commute often takes her through the insurgent-filled province of Maidan Wardak. "Last year we were caught in a gunfight between Afghan forces and insurgents for three hours. We couldn't move."

And violence is slowly encroaching on Nili itself. Daykundi has long been known as one of the least dangerous and most isolated provinces in Afghanistan. But the Taliban are making increasingly bold moves on Nili, advancing from a district called Gizab, on the border with Uruzgan and technically under that province's jurisdiction.

For many years, it was the very lack of an insurgency that starved Daykundi of adequate attention from foreign donors. Now, Jafari says, that argument is running on borrowed time.

Between 2001 and 2011 the US government's development agency, USAid, spent $37m (£24.4m) on projects in Daykundi province, which has a population of just over 400,000 but no Nato-backed provincial reconstruction team (PRT). By contrast, the more dangerous Uruzgan province, which borders Daykundi to its south and is home to 100,000 fewer civilians, received almost twice as much aid over the same period and hosts a PRT.

Like thousands of Afghans, Jafari fled the civil war in the early 1990s, taking refuge in Iran, where she ran a school for Afghan refugee children. She moved back to Afghanistan in September 2001 to take part in a peace jirga (a tribal assembly of elders) as the fall of the Taliban became imminent. She has also published two books, one entitled I am a Working Woman, which she wrote for women with low levels of literacy.

When we met, Jafari was dressed in a fitted beige knee-length tunic, buttoned down the front and worn over trousers. Her hair was neatly covered with a black shawl splashed with bright colours and loosely wrapped around her neck. It is a typical Kabul look, but perhaps seen as less acceptable in a much more conservative and rural place such as Nili.

"I like to dress formally," she explained. "This means clothes tend to be more fitted and a bit tighter, but this is the way formal, professional people dress. Not traditional loose, wide clothing, and people need to accept this."

She has never changed what she wears, even in the face of criticism and gossip, as she sees it as part of her job to encourage people to understand that the way someone dresses has no bearing on who they are or their ability to get a job done properly.

"What I've really learned is that it makes no difference whether you are a man or a woman, what matters is that you do your work properly and you work hard and how seriously you take your responsibilities," she said.

As Afghanistan's first and only female mayor, Jafari is determined to make her mark not just on infrastructure but on attitudes towards women. She feels strongly that since being in Nili, she has influenced the way younger women think, and for the better. She says one day she may angle for the top job in government, but she would like to become a member of parliament before aiming for the presidential palace. "I'm like a template for women," she said.

The morning after the interview, Jafari set off, with Indira in tow, on their long and dangerous journey to Nili.

Additional reporting by Ellie Kealey