Turkey has joined Russia in becoming the second non-Arab country to open its doors to Hamas officials. A five-man delegation, headed by Hamas leader Khaled Mashaal, arrived in the Turkish capital Thursday.

Reflecting the controversial nature of the visit, it was first announced that the Hamas delegation would be received by Turkey's prime minister, Recep Tayyip Erdogan. Hours after the delegation arrived, the prime minister's office said the meeting would not be taking place after all.

Instead, Mashaal and his men would be holding meetings with officials from the ruling Justice and Development Party at the party's Ankara headquarters. Foreign Minister Abdullah Gul was expected to take part in the discussions.

Western diplomats said the visit would likely harm Turkey's strong ties with the Jewish state. The relations, which are underpinned by intense military cooperation, had already come under strain over Erdogan's assertions two years ago that Israel was engaged in state terrorism against the Palestinians.

Gul defended Turkey's decision to receive Hamas officials, stressing that the meeting was taking place at their request. The foreign minister said Turkey's role was to help ensure that Israelis and Palestinians peacefully coexist.

Gul said that since Hamas won a democratic election, from now on it must act in a democratic way.

The foreign minister said he telephoned Israel's foreign minister, Tzipi Livni, to explain the nature of the talks. In a statement, the Israeli foreign ministry said Livni had expressed Israel's objections to talks with what it termed "terrorist organizations."

Officials close to the talks said the Hamas meeting had been organized at the last minute and had been opposed by the Turkish foreign ministry. Senior members of Mr. Erdogan's Justice and Development Party, which has its roots in political Islam, are believed to have played a key role in arranging the meeting.

The Islamic militant group swept to power three weeks ago in elections that shook the Middle East. The United States and the European Union, which Turkey wants to join, describe Hamas as a terrorist group. They are demanding that Hamas renounce violence, disarm and recognize Israel's right to exist as a pre-condition for entering dialogue with the group. Analysts are saying Turkey's decision to step out of line with U.S. and EU policies may earn it praise in the Muslim world, but will likely damage its image with its Western allies.