Israel's new prime minister has a challenge: The Turkish-Israeli relationship - the country's only public and normal relationship with a Muslim-majority country - is dangerously strained. The deterioration of the public face of the relationship, exemplified by Prime Minister Recep Tayyip Erdogan's harsh anti-Israeli rhetoric, attacks against Israeli athletes in Turkey and the bombing of an Israeli-owned bank in Istanbul, is troubling. Some might take comfort in strong military ties between the countries, but the new prime minister ought to note that without a strong public connection, bilateral ties will not persist against surging anti-Israeli sentiments in Turkey. Turkey has long been an intimate friend of both the Israelis and the Palestinians. In February 1949, Turkey was one of the first countries, and the first Muslim-majority state, to recognize Israel. And, in 1988, Turkey was the first country to recognize the declaration of a Palestinian state, opening a Palestinian embassy in Ankara. THIS PATTERN has, however, changed since the Justice and Development Party (AKP) government came to power in 2002. The AKP aligned itself with Hamas - a policy made public in 2005, when the AKP invited Hamas to Ankara. This episode was later treated as a political glitch, but events since the beginning of Israeli operations in Gaza in December 2008 prove otherwise. Erdogan has said he is "not aware that Hamas' rockets are killing any civilians," questioned Israel's UN seat, and added that he sees Hamas as a "reform party" which he would like to represent Palestinians on international platforms. Government acts have followed AKP rhetoric. On January 13, the Education Ministry had more than 16 million Turkish students, some as young as six, stand for a minute of silence to condemn Israel and support the Palestinians. This act is hugely symbolic; Turkish students stand in silence only to commemorate Kemal Ataturk's death. Not even the massive earthquake of 1999, which killed more than 17,000, was followed by a similar public gesture. Such AKP rhetoric and acts have not been without public consequences, and the Israelis have come under attack in Turkey. On January 12, Israeli-owned Bank Pozitif was bombed in Istanbul. And on January 13, an Israeli girls' volleyball team came under attack in Alanya as spectators chanted, "Muslim police, bring us the Jews so we can slaughter them." Other anti-Semitic incidents have followed; recently, fliers calling for a boycott of Jewish-owned businesses were distributed in Istanbul's mixed Jewish-Muslim neighborhoods. These are troubling signs. Until 2008, economic and cultural relations were a significant component of bilateral ties. Mutual trade exceeded $4 billion, and more than 500,000 Israelis a year visited Turkey, making it a top destination for Israeli vacationers. Conferences, exchanges and investment projects were a mainstay of the relationship. All this could end. With the rise of a hostile environment in Turkey, Israelis will not feel comfortable traveling there on vacation, attend panels, invest or play sports. As evidence of this trend taking root, January's travel bookings to Turkey were down by as much as 70 percent. ERODING PUBLIC TIES pose a problem for the future of military ties. With diminishing Turkish popular support for bilateral ties and weakening cultural and economic relations, the military relationship will have to go under the radar to survive. In this regard, it would be shortsighted to ignore the role of public opinion in shaping Turkey's foreign affairs. Israel can maintain a security relationship with Egypt despite objections of the Egyptian people because Egypt is an authoritarian regime. This strategy cannot work with Turkey. Turkey is a democracy. Popular objections to military ties with Israel will reshape, check and eventually cripple these ties. It would indeed be sad if the Turkish-Israeli relationship withered, as it benefits both sides. For instance, Israel provides Turkey with useful technology, including unmanned aerial vehicles, to fight the Kurdistan Workers Party's (PKK) terror infrastructure in northern Iraq. In return, Ankara provides tiny Israel with "strategic depth" - the ability to train in Turkey's vast air, land and seascape. At this juncture after the deluge, the two countries should resist the knee-jerk temptation to downgrade military ties. Instead, they should focus on rebuilding the public, economic and cultural components of the relationship. This process could start with high-level visits, increased military cooperation, public relations campaigns in both countries and mutual assurances that Turkey is safe and welcoming for Israelis again. The weakening of Turkish-Israeli ties is also a problem for the United States: America's two best friends in the Middle East are at odds. Alliances like the Turkish-Israeli friendship for Washington come once in 100 years in the Middle East. President Barack Obama should promote the rebuilding of ties between Turkey and Israel. The writer is a senior fellow at the Washington Institute for Near East Policy and the author of Islam, Secularism, Nationalism in Modern Turkey: Who Is a Turk?