Three hundred thousand people displaced. Villages and infrastructure destroyed. Allegations of white phosphorus use. The costs of the Turkish invasion of northern Syria to create a “safe zone” are immense, the latest twist in the seemingly intractable Syrian war.

Beyond the immediate human costs, there lies also a deeper loss. Rojava, the Kurdish name for the autonomous region of northern Syria, into which the Turkish army is advancing, is more than a geographic area. It is also an experiment in democracy and equality. It is, in fact, one of many such experiments that have flourished during the years of the Syrian war, shaped by the work of thinkers such as the late Omar Aziz. Most have been crushed either by Bashir al-Assad’s regime or by Islamic State, which once controlled large areas of Syria. Now Rojava, too, is threatened with destruction.

It was out of the turmoil of the early years of the Syrian war that Rojava was born. In 2013, the Democratic Union party (PYD), the main political force in the region, established a coalition called the Movement for a Democratic Society (TEV-DEM) and declared autonomy for the region. Many no longer refer to it as Rojava but as the Democratic Federation of Northern Syria, to acknowledge that it is home not just to Kurds but to Arabs, Christians and other minorities.

Central to the success of Rojava has been the People’s Protection Units, or YPG, a militia established to protect Kurds, and the YPJ, the women’s militia set up in 2013. In 2015, the YPG and the YPJ joined with non-Kurdish militias to form the Syrian Democratic Forces, or SDF. The YPG, the YPJ and the SDF led the struggle against Isis at great cost to themselves. Their courage won much admiration. Less noticed has been the internal transformation of Rojava, carved out in the face of a ferocious war.

In a region that has become almost a byword for tyranny and oppression, Rojava is an embodiment of a different kind of politics. Its style of direct democracy allows local communities, from the village level up, to make many of the decisions and take on as much self-government as they can.

Even more striking has been the pursuit of gender equality. Traditional reactionary practices, such as polygamy and sharia courts, have been swept away. New rights, such as abortion and equal pay, have been enforced. Every public organisation is required to have at least 40% of both men and women. There is also a policy of “co-governance” – every office in government is led by both a man and a woman.

The PYD draws many of its political ideals from Abdullah Öcalan, a founder of the Turkish PKK (Kurdish Workers’ party), which has long leveraged violence in the pursuit of Kurdish independence. Captured and imprisoned by the Turkish authorities in 1999, Öcalan has in recent years transformed from a Maoist to a libertarian. Influenced by the American environmentalist and libertarian socialist Murray Bookchin, he has rejected the idea of a separate Kurdish nation state, arguing instead for “direct democracy without a state” and for the centrality of women’s rights in any social change.

The PYD’s adoption of this approach, and its abandonment of the goal of a Kurdish state, has created tensions with other Kurdish groups. “We don’t want separation,” the YPJ’s Nesrine Abdullah told me. “We want to establish a non-central, multicultural and multi-language Syria.”

The American betrayal of the Kurds has forced the Rojava authorities to make a deal with Damascus

There is a danger of romanticising the Rojava revolution. There have been credible allegations of ethnic cleansing and of the silencing of dissent. A report from Chatham House, the international affairs thinktank, suggests that, for all the talk of decentralisation, the PYD still ensures it retains access to power.

Such allegations are worrying and need to be addressed. One must also remember, however, that the “Rojavan revolution” has flowered in the most trying of circumstances, in the midst of a brutal war.

So what now? The American betrayal of the Kurds has forced the Rojava authorities, in the face of the Turkish assault, to make a deal with Damascus, allowing Syrian troops back into Rojava. It is unlikely that Assad will countenance the continuation of the Rojavan experiment in democracy and equality.

It will be a tragedy if Rojava is crushed, the latest in a long history of the betrayal of Kurds. Rojava was not, however, the first spark of freedom in the region and it will not be the last. As mass protests in Iraq and Lebanon reveal, it’s a spark that refuses to be extinguished.

• Kenan Malik is an Observer columnist