There are several very good reasons why Europe should reach out to Turkey.

One of them is obvious. The mass demonstrations currently engulfing Turkey’s cities show that a large and courageous number of Turkish people are attached to the same values as Western Europeans. Turks are taking to the streets to counter what they see as an increasingly authoritarian and sectarian style of government.

This alone would deserve the EU’s support. Every day now, Turkish crowds are disproving the argument—so cherished by EU countries like Germany, France, the Netherlands, or Austria—that Turkey simply does not fit in with Europe.

But there are other motives for engagement, too.

First, promises must be kept. The EU has been stringing Turkey along for many years. The fact that France recently lifted its veto over two chapters of Turkey’s EU accession negotiations doesn’t count for much if so many other member states continue to drag their feet. This must stop if Europe wants to retain its credibility vis-à-vis the Turkish people.

Then, Prime Minister Recep Tayyip Erdoğan’s record in office deserves some credit. While it is true that he has been stalling on judicial reform and clamping down on press freedom, he also has some remarkable achievements to show.

In his ten years in power, Erdoğan has never been an easy interlocutor for European leaders. But, against all the odds, he pushed ahead with economic and political reforms—as the EU demanded. He has removed the military from the center of power and sent it back to its barracks—another EU demand. And he has given the Kurds access to Kurdish-language radio—again, another EU demand.

Erdoğan also opened up secret channels of negotiations with Abdullah Öcalan, the imprisoned leader of the Kurdistan Workers’ Party (PKK), to try to end the long and bitter Kurdish conflict. Recall that, last March, Öcalan called on PKK forces to observe a ceasefire and withdraw from Turkey. That was a huge shift in Turkish-Kurdish relations. The EU welcomed it, too.

Beyond domestic reforms, there also is a foreign-policy reason why the EU should reach out to Turkey at this particular moment. This reason is counterintuitive.

The EU needs to help Turkey because Ankara’s foreign policy is adrift in a potentially dangerous way. Given Turkey’s size and strategic importance in a highly combustible region, Europe needs to anchor Turkey to the West. That means being sincere about the country’s accession negotiations.

The most important issue in Turkey’s region is the Syrian conflict, which broke out over two years ago. Back then, Erdoğan hoped that Bashar al-Assad, the Syrian president, would introduce political reforms and engage the opposition.

Indeed, Erdoğan was pinning his hopes on his personal friendship with Assad, which in turn would vindicate his foreign-policy doctrine of “zero problems” with Turkey’s neighbors.

Assad’s refusal to heed Erdoğan’s advice was a big dent in the “zero problems” strategy, besides being a personal setback for Erdoğan. His massive disappointment explains why he then chose to give full backing to the Syrian opposition—despite widespread domestic criticism of that turnaround.

For Erdoğan’s Turkish critics, this hard line meant that Turkey would not be able to play the role of honest broker in any final settlement that might include Assad.

Erdoğan’s other ambitions, from mediating in the standoff between Iran and the West over Tehran’s nuclear program to trying to normalize relations with Armenia, did not go well, either. Above all, the idea that Turkey could become a major strategic player in the region was called into question.

To say now that Turkey got what it deserved from a misconceived and overambitious policy would be easy—but wrong. From a European perspective, Turkey remains a hugely important mediator between East and West, Christianity and Islam. If it manages to revive its historical friendship with Israel, it can also be an important partner for a wider Middle East settlement.

Europe cannot afford a Turkey that is unstable, that gives the generals the slightest opportunity to insinuate themselves back to power, or that allows its foreign policy to drift further. In turn, Turkey needs Europe because Turkey would be much stronger—strategically but also economically and politically—if it were linked institutionally to Europe.

Now is the time for Europe to talk Turkey.