As dusk enveloped the salmon-pink houses of Laayoune, the brightly coloured robes of women stood out in a mass of protesters in the centre of the capital of Western Sahara chanting for independence from Morocco.

While other African colonies threw off occupiers one by one, this desert expanse on the continent's north-western coast remains a disputed territory controlled primarily by next-door Morocco and locked in a nearly 40–year struggle for the right to choose its fate. Unusually for a Muslim society, women play a prominent role in Western Sahara's independence movement.

Their involvement has spanned a guerrilla war and, for the past two decades, a mostly peaceful protest movement. Female activists in the former Spanish colony attribute this to a combination of the Sahrawi population's moderate interpretation of Islam and the freedom they derived from their nomadic roots – but also to the prevalence of traditional gender roles, which they say give women the time to demonstrate.

"This is a pride for us, that this is led by women," said Arminatou Haidar, a Nobel peace prize nominee and the most recognisable face of Western Sahara's nationalist movement.

But as its duration shows, the campaign is an uphill battle that has so far been won by Morocco, which annexed most of Western Sahara after the Spanish withdrawal in 1976. Morocco argues that Western Sahara with its rich fishing grounds, lucrative phosphate mines and offshore oil – is an integral part of its territory and that separatists represent a fraction of the population of about 500,000.

That is now probably the case, because Moroccan citizens – whom the Moroccan government entices to the area with tax breaks – are now believed to outnumber the 150,000 or so Sahrawis inside the territory by at least two to

Most nations, including the US, do not recognise Morocco's sovereignty over Western Sahara, but calls by the Sahrawi people for a referendum on independence have made little traction. Experts say that is due to a combination of Moroccan lobbying against the proposal, lack of international will to upset one of the region's most stable countries and arguments between Morocco and the Sahrawis' rebel movement-turned-government-in-exile, the Polisario Front, over who should vote.

one. Moroccan officials argue that an independent Western Sahara is not viable and that its longtime enemy Algeria is backing the cause to stir problems.

"There is no room for a failed state in the region," Moroccan deputy foreign minister Saadeddine Othmani told reporters in May. "It will fall into the hands of extremists."

Despite regular protests, victories are small. Still, it appears to have brought about a shift in Moroccan policy, which now supports making Western Sahara an autonomous region within the Moroccan state.

"Even if I don't reach that day when the Sahara is independent, I am completely convinced that the next generation is going to live the day of independence," Haidar said.

Instead of the dozens of people that most protests draw, the May march drew well over 1,000, hundreds of them women. Some activists described it as the largest in the history of the independence movement, and they attributed the crowd in part to anger over a recent UN security council decision not to approve a US proposal to grant the UN peacekeeping mission in the Western Sahara a mandate to monitor human rights. The United States later abandoned the proposal after strong opposition from Morocco, which cancelled a joint military exercise between the two countries in protest.

The role of women can be partially attributed to the Sahrawis' nomadic background, said Djmi El Ghalia, a prominent activist. While men travelled, women controlled household finances and ran the community. That legacy was consolidated in the refugee camps in Algeria, home to the Polisario Front and an estimated 165,000 Sahrawis who fled during the 16-year war with Morocco, which ended in 1991. Women are responsible for much of the administration of the camps.

"Compared to the status and role of women in the Islamic societies along the Mediterranean coast, Arabia . . . women in Western Sahara enjoy significant advantages," said Jacob Mundy, an assistant professor at Colgate University and co-author of Western Sahara: War, Nationalism and Conflict Irresolution.

"The war gave women in the camps more opportunities to become involved in the daily operations of the independence struggle and the effort to build a state in exile," he said, while across the border in the territory, female activists play a "huge role".

Sahrawi female activists say they generally have freedom to express their political views, and women divorce without stigma.

Female empowerment spans both ends of the political spectrum, and some women work in support of the Moroccan government. Malainin Oum El Fadl is among them. She heads Espace Associatif Laayoune, a women's collective that gives grants to small businesses and was established after thousands of Sahrawis set up a protest camp near the capital in 2010, which was later dismantled by Moroccan authorities.

And not all is positive for women in the Algerian camps, where there have been reports of women being imprisoned for adultery and they remain excluded from the highest political posts. In Western Sahara, too, while traditional gender roles have freed women to push for independence, those norms also often mean they do not pursue careers.

"It's about the space provided," El Ghalia said. "Women stay at home and get more involved; at the same time, men don't want to lose their jobs."

Women have paid a high price for their role in the struggle. Both El Ghalia and Haidar spent years in detention centres in the late 1980s, when forced disappearances of Sahrawis were widespread.

Sitting in a traditional tent erected on the rooftop of her Laayoune home, El Ghalia pulled back her headscarf to show her scarred scalp, which she said was doused in chemicals while in detention. She said she spent most of nearly four years blindfolded and was often stripped naked and subjected to torture. "I still have the scars from the dogs biting my flesh," she said.

Though the darkest abuses are over, they still go on. Last month, Human Rights Watch reported that Moroccan courts have convicted Western Saharan activists on the basis of confessions obtained through torture or falsified by police.

In a hotel in Laayoune, another activist, Sultana Khaya, recalled a 2007 protest during which she said a policeman beat her face, causing her to lose one eye. She showed bruises from a recent run-in with police.

"This is just small testament compared to the testaments of other Sahrawi women since 1975," said Khaya, 32. "The Sahrawi woman is very great; she's very powerful. I don't even think about getting married until the Sahrawi women become independent."

This article appeared in Guardian Weekly, which incorporates material from Washington Post