U.S. policy in the Middle East is f loundering. President Obama’s two most important allies in the region are on a collision course. It will not be resolved by the State Department’s injunction to Turkey and Israel to “cool it.”

Turkey’s importance to Washington is clear: its involvement in NATO and its forces in Afghanistan; its strong economic ties to northern Iraq; its ongoing cooperation against terrorism; and, most recently, its role in the NATO missile defense shield. The depth of the U.S.-Turkey alliance makes the crisis in Israeli-Turkish relations one that equally involves the United States.

Turkish Prime Minister Recep Tayyip Erdogan has expanded his confrontation with Israel beyond the 2010 Gaza flotilla incident and into a full-scale assault on Israel’s position in the region. He recently declared that the Turkish navy will escort Turkish vessels going to Gaza to provide aid. Washington did not grasp where Erdogan’s sustained verbal attacks on Israel were heading. He now directly challenges our major alliance in the Middle East, and how far he will go is unclear. Obama himself must acknowledge that the situation is a crisis. As the political climates in Turkey and the United States harden, Erdogan and Obama will find it increasingly difficult to compromise.

Foreign Minister Ahmet Davutoglu said years ago that Turkey would construct a new order in the region. Erdogan followed this with criticism of interference in Middle Eastern affairs by “outside” powers, a clear shot at Washington. Erdogan’s rhetoric of late is about reducing Western influence in the region and teaching Israel a lesson for “irresponsible” or “immature” behavior.

Had Erdogan pushed only for an apology over the deaths of Turkish citizens in the May 2010 flotilla incident, Turkey’s actions would be understandable in the face of Israel’s unwise decision not to immediately resolve the problem. The recently leaked U.N. report on the flotilla affair sought to find a way for the sides to reconcile. Erdogan, however, is not interested in repairing the situation with Israel.

Erdogan is calculating that, as a NATO member, a European Union candidate country and the world’s 16th-largest economy, Turkey can move the Middle East in ways no other regional country can. He has significantly expanded Turkey’s trade and investment. He has successfully pivoted away from Libya and Syria, where he had been closely affiliated with the authoritarian regimes. He is wildly popular on the Arab street, and his address to the Arab League last Tuesday could well be a bid for the populist mantle last held by the late Egyptian president Gamal Abdel Nasser. His vigorous battle at the United Nations for a Palestinian statehood resolution is another step in his effort to isolate Israel.

By threatening to militarily contest Israel’s blockade of Gaza — which was deemed legal by the U.N. Palmer Commission — the Turkish government has laid down a serious challenge to American policy. Danger stems not just from potential miscommunication between those two countries but also from third parties with their own agendas, creating conditions for confrontation.

The eastern Mediterranean is already a caldron of competing claims and threatening rhetoric. Turkey’s minister for E.U. affairs warned this month that his country might stop Cyprus’s exploration for gas and oil, saying, “This is what we have the navy for.” Lebanon’s Hezbollah-dominated government is engaged in a verbal war with Israel over the latter’s gas discoveries off the coast at Haifa. Erdogan involved Turkey in negotiations between Cyprus and Israel on joint exploration opportunities when he told al-Jazeera this month that Israel would be prevented from exploiting the eastern Mediterranean’s oil and gas reserves on its own.

Washington is caught between two longtime allies. It cannot deal with the Israelis and Turks separately. Inaction is not a real option, as Israel could become a significant issue in the 2012 presidential campaign, especially if the United States is defeated in its opposition to a General Assembly vote to create a Palestinian state. The situation will generate concern on Capitol Hill and give Republicans another opportunity to attack Obama for not defending American interests and Israel.

Congress could also worsen the fray by reviving legislation regarding the Armenian genocide. A resolution recognizing the 1.5 million Armenians killed by Ottoman Turks has repeatedly failed to garner enough support for a floor vote. But its backers may calculate that the worsening conditions between Israel and Turkey would prompt the powerful Israel lobby to no longer support Turkey on this matter, raising the likelihood that the resolution would pass. Similarly, arms exports to Turkey will face greater scrutiny.

Obama may not have much time to prevent further deterioration. Israel has been seeking to build ties with Asia, Europe and the Americas; while the Arab Spring evolves, Israel is becoming increasingly isolated as countries such as Egypt and Jordan reassess ties. It is also floundering from the Obama administration’s mishandling of the peace process and of Israel in particular.

Obama’s meeting with Erdogan on Tuesday is crucial. He can take a few important steps. He should immediately deploy 6th Fleet ships from Norfolk to the Eastern Mediterranean to signal that the United States will not tolerate even inadvertent naval clashes. He needs to make clear to Erdogan that the United States will not side with Turkey against Israel and that Turkey’s current strategy risks undermining regional stability.

Obama could offer to work with Turkey and Israel to end the partial blockade of Gaza, provided Erdogan can persuade Hamas to abandon, once and for all, missile barrages and violence against Israel. Such a policy course would have wide international backing and give everyone some of what they want.

Erdogan has a choice: He can boost his domestic and regional popularity by deepening the confrontation with Israel or he could think beyond that by engaging in a constructive endeavor that will help regional stability.

Morton Abramowitz, a senior fellow at the Century Foundation, was U.S. ambassador to Turkey from 1989 to 1991. Henri J. Barkey is a professor of international relations at Lehigh University.