ZAGREB — The European Union's foreign policy chief called Thursday for better relations with Russia and Turkey as the two countries announced a cease-fire in Syria, a move that highlighted once again how much leverage they wield over the EU.

The war in Syria has had a direct impact on the 27-member bloc, contributing to the refugee and migration crisis of 2015. The EU has felt the effects of the conflict once more in recent days, when Turkish President Recep Tayyip Erdoğan announced he would no longer stop refugees heading for Europe after at least 33 Turkish soldiers were killed in the Syrian province of Idlib.

Russia and Turkey back opposing sides in the Syrian war and are also key players in Libya, the scene of another destabilizing conflict in Europe's neighborhood.

If the truce holds, the cease-fire in Idlib could reduce the tension on Greece's border, given that Turkey's decision to declare its borders open was at least in part motivated by the escalating violence in Syria. Previous cease-fire deals in Idlib have collapsed, however.

"Our relations with these two countries are difficult for sure. But we have to improve them," Josep Borrell, the EU's high representative for foreign policy, said in a statement after meeting the bloc's foreign ministers at a castle outside the Croatian capital, Zagreb. "We have been accumulating difficulties and we have to restart a new approach in order to overcome these difficulties."

Greece and Cyprus have demanded tough responses to Turkish actions such as unauthorized drilling for gas and oil in the Eastern Mediterranean.

On Russia, the former Spanish foreign minister said the EU would stick to the principles it agreed following Moscow's annexation of Crimea.

But he also said the bloc had to "increase our engagement on selective issues in which we have to have a good partnership with Russia — energy, climate change, [the] Arctic. Russia is engaged in Syria, is engaged in Libya, playing important roles that affect our security."

His stance echoed a drive by his predecessor, Federica Mogherini, for "selective engagement" with Moscow.

On Turkey, Borrell noted that the tensions on the Greek border were linked to the fighting in the rebel stronghold of Idlib, the target of a military offensive by Syrian President Bashar al-Assad's forces and their Russian allies that has forced almost a million people from their homes.

He criticized Ankara for making people believe that the borders of Europe were open. "We have to defend our borders," he said. "At the same time, we have to talk with the Turks about many issues that affect directly our security because Turkey is also playing an important role in the Libyan crisis."

But some EU members are wary of getting too close to Moscow and Ankara.

The EU imposed sanctions on Russia following its military intervention in Ukraine and annexation of Crimea, and has accused Moscow of carrying out assassinations and other destabilizing activities on European soil.

While some EU leaders, such as French President Emmanuel Macron, have called for a reset of relations with Moscow, others — particularly in Central and Eastern Europe — have warned against such a course, arguing it would be seen by President Vladimir Putin as a reward for bad behavior.

On Turkey, leaders across the EU have condemned Erdoğan for his increasingly authoritarian rule. And Greece and Cyprus have demanded tough responses to Turkish actions such as unauthorized drilling for gas and oil in the Eastern Mediterranean.

Diplomats said establishing a secure zone would be fraught with difficulty and the EU has so far shown no willingness to put any military muscle behind these ideas.

Yet Thursday evening's announcement from Erdoğan and Putin, made after talks in Moscow, underscored that the two leaders are among those literally calling the shots in the EU's backyard.

A senior EU official said the cease-fire deal should be welcomed but added a note of caution. "We can only hope that this is sustainable because it doesn't say anything about the monitoring," the diplomat said. "Details will be absolutely relevant."

Some EU leaders have sought in recent days to show they can also play a role in Syria. German Chancellor Angela Merkel has called for a secure zone inside Syria, in which those displaced by the war could receive humanitarian aid. The Dutch government has floated a similar idea, calling for a no-fly zone.

However, diplomats said establishing such a zone would be fraught with difficulty and the EU has so far shown no willingness to put any military muscle behind these ideas.

"The EU cannot create a safe zone, we are not so powerful," Borrell acknowledged at an earlier press briefing in Croatia. But, he added, "we can have influence on the U.N. and on NATO."

Many diplomats see the idea of NATO involvement as a nonstarter. Even if the alliance's members were willing to countenance a role in Syria, diplomats say, Russia would not accept it.

Dutch Foreign Minister Stef Blok told reporters that, to implement a safe zone, "the ideal would be to have a [U.N.] Security Council resolution." But many observers believe Russia would veto any such move.