On October 9, Turkey launched a military operation in northeastern Syria to push back “terrorist” elements from the border region to the east of the Euphrates River and establish a “safe zone” stretching at least 30km (19 miles) into Syria to resettle some of the 3.6 million Syrian refugees it hosts.

This was an operation long in the making, and it should not have come as a surprise to anyone who has been watching the region closely in the last few years.

Ankara considers the Kurdish People’s Protection Units (YPG), the group that is currently in control of the region targeted by Turkey’s operation, an extension of the Kurdistan Workers’ Party (PKK), which has waged a decades-long armed campaign against the Turkish state for autonomy. Consequently, it views the presence of a YPG-controlled entity at its southern border as a serious threat to its national security and territorial integrity.

Turkey’s President Recep Tayyip Erdogan made it clear to his country’s Western partners from the very beginning that he would not under any circumstances allow the YPG to remain in control of northeastern Syria in the long term. He also made every effort possible to convince both Washington and Brussels to not use the YPG as a proxy in the fight against the Islamic State of Iraq and the Levant (ISIL, or ISIS).

All his pleas and warnings, however, fell on deaf ears. And eventually, for Ankara, a military operation against the YPG in Syria became an inevitable necessity, a matter of self-defence.

But when the operation started, Turkey’s European partners acted as if the move was just an impulsive act of aggression against Syria’s Kurds.

The EU not only strongly condemned the operation, but its members also swiftly called for a UN Security Council meeting to issue a joint statement against Turkey. Although such a statement was never realised thanks to opposition from Russia and the US, the body’s European members went on to issue a separate statement that criticised Ankara.

The European effort to rebuke Turkey did not stop there. Last Monday, EU foreign ministers met in Brussels once again to put further pressure on Ankara. In a joint statement, they denounced Turkey’s military operation claiming that it “seriously undermines the stability and the security of the whole region”.

Although the foreign ministers could not agree on imposing an EU-wide arms embargo on Ankara in this meeting, several European countries – including France, Germany, the United Kingdom, Spain and Italy – announced that they would halt arms exports to Turkey. Furthermore, they threatened to impose further sanctions on Turkey in their October 17-18 meeting.

The EU’s swift response to Turkey’s operation in Syria against the YPG exposed the 28-member body’s hypocrisy when it comes to protecting “the stability and the security” of the Middle East.

The same European countries that recently imposed sanctions on Turkey for attacking the YPG see no problem in continuing their arms sales to a country like Saudi Arabia, which is responsible for a war in Yemen that already killed tens of thousands of civilians.

The EU has an arms export policy – the 2008 Common Position on arms export controls – which sets out the criteria by which member states must judge potential export licenses, including respect for human rights and international humanitarian law in the destination country. When the UN’s experts concluded that Saudi Arabia is violating international human rights and humanitarian law in Yemen, therefore, all EU member states should have stopped their arms exports to the kingdom.

Such an export ban, however, never materialised.

According to the EU’s own reports, EU member states issued at least 607 licences worth over 15.8 billion euros ($17.6bn) to Saudi Arabia in 2016 – a year after the start of Yemen’s devastating conflict.

In 2017, France approved export licenses potentially worth 14.7 billion euros ($16.4bn) to Saudi Arabia. Not only did France not stop arms shipments to Saudi Arabia after it had been established that Riyadh committed war crimes in Yemen, French intelligence tried to silence journalists who reported on the use of French weapons in Yemen’s war.

In 2018, Saudi Arabia was the second-biggest client of Germany’s arms industry after Algeria. From January to September of that year, the German government approved arms exports worth 416.4 million euros ($463.3m) to Riyadh.

Germany did eventually impose a six-month-long arms ban on Saudi Arabia, in response to the brutal murder of journalist Jamal Khashoggi at the kingdom’s Istanbul consulate in October 2018. But none of the other EU member states ever felt the need to stop selling weapons to Riyadh.

Even when an appeals court in the UK declared the country’s arms sales to Saudi Arabia “unlawful” in June this year, the UK government, which is now saying it cannot continue its arms sales to Turkey in light of its operation against the YPG, did not agree to suspend the flow of arms from London to Riyadh.

The EU, clearly, is applying double standards to Saudi Arabia and Turkey.

EU member states are punishing Turkey, a NATO ally, for an operation that it felt forced to embark on as a result of their own questionable decision to partner with the YPG in the fight against ISIL. And they are doing this while practically ignoring Saudi Arabia’s relentless assault on the very same region’s poorest country.

They are punishing Turkey for striking the Syrian faction of an armed group they themselves willingly classified as a “terror organisation”, while ignoring the fact that Saudi Arabia starved civilians to score points in Yemen.

They are punishing Turkey for allegedly undermining “the stability and the security of the whole region”, while ignoring the devastation Saudi Arabia caused in the very same region using their weapons.

For decades Turkey tried to become a member of the European Union and for decades it has been told it is not good enough. If for some reason Turkey is still interested in joining the European club, perhaps it should try to be more like Saudi Arabia.

The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial stance.