The destroyer USS Donald Cook and a submarine-tracking P-8A Poseidon took part in the drills, designed to improve teamwork at sea between the navies of the U.S., Turkey, Bulgaria, Romania and Britain.

“Participating in exercises like Dogu Akdeniz helps to enhance the professional relationships between everyone involved,” said ship Command Master Chief Petty Officer Jeremy Douglas. “(It) helps to improve the communication and coordination between allies and partner militaries.”

The naval forces worked to mesh their skills, technology and tactics to defend against hostile submarines, aircraft and ships. Sailors also received live-fire training.

The Poseidon played a key role because of its ability to hunt and destroy submarines and attack planes and ships.

The show of solidarity at sea came amid friction between Ankara and other NATO members.

Diplomatic relations between Turkey and the U.S. strained last month after Turkey arrested a U.S. consulate staffer suspected of taking part in last year’s failed coup. The spat led to the U.S. and Turkey freezing non-immigrant visas required for travel between the two countries. On Nov. 6, they both resumed issuing a limited number of visas.

Turkey also has condemned the U.S. for arming Kurdish fighters in the war against the Islamic State in Syria. Ankara believes the Kurds are part of a terrorist group that could threaten Turkey’s southern border once ISIS is driven out. And in September, Turkey concluded a controversial deal with Moscow to buy Russian S-400 anti-aircraft missiles.

Analysts say such Turkish military policies don’t align with NATO’s needs and show a pivot toward Russia since the aborted coup. Recent actions display “potentially problematic tendencies” that run counter to NATO’s interests, said Bob Rook, a history professor at Towson University in Maryland.

Turkey’s naval capability is seen as a NATO asset but also can be viewed as an instrument for a foreign policy independent of NATO, Rook said.

“Where that matters a great deal is the eastern Mediterranean,” Rook said.

Turkey has also used its Navy to harass research vessels from neighboring Cyprus in its dispute over offshore oil and gas exploration, Rook said.

Greek Cypriots claim drilling rights in waters around the entire island under maritime law. Turkey refuses to recognize those rights and contends that it is entitled to some of the deposits.

As the allies conduct exercises with Turkey as a NATO partner, they should think about how Turkey might use the skills it gains, Rook said.

“Turkey’s regional strategic agenda should be taken into consideration,” he said.

O Almighty Lord God, who neither slumberest nor sleepest; Protect and assist, we beseech thee, all those who at home or abroad, by land, by sea, or in the air, are serving this country, that they, being armed with thy defence, may be preserved evermore in all perils; and being filled with wisdom and girded with strength, may do their duty to thy honour and glory; through Jesus Christ our Lord. Amen.