A Syrian refugee walks at the Zatari Syrian Refugee Camp, northeast of Amman, Jordan, on Monday. Lebanon is hosting an estimated 630,000 Syrian refugees who have fled the civil war in Syria. (Jamal Nasrallah/European Pressphoto Agency)

Dennis Ross, a counselor and fellow at the Washington Institute for Near East Policy, was a special assistant to President Obama from 2009 to 2011. His book “Doomed to Succeed: The U.S.- Israeli Relationship from Truman to Obama” will be published Oct. 13.

President Obama has been consistent on Syria. Even when I was in the administration, the president made clear that he did not want to get dragged into the conflict there. The legacy of Iraq weighed heavily on him. He was elected to get us out of Middle East wars, not into them. He was not going to get involved in “someone else’s civil war.”

But what if that civil war produced a humanitarian catastrophe? What if it created a massive refugee crisis? What if it threatened to destabilize neighboring states? What if it gave rise to a group like the Islamic State? These questions were not considered because the fear of being dragged into a quagmire was so great. The costs of action always determined the administration’s approach, not the costs of inaction.

It is nothing new for Obama to challenge those who think the Iranians or Russians are gaining in Syria as they act and we do the minimum. In March 2014, he said, “I am always darkly amused by this notion that somehow Iran has won in Syria. . . . This was their one friend in the Arab world . . . and it is now in rubble. It’s bleeding them because they’re having to send in billions of dollars. . . . They’re losing as much as anyone. The Russians [too] find their one friend in the region in rubble and delegitimized.”

Eighteen months later, Obama thinks little has changed. In his news conference last week, he said, “An attempt by Russia and Iran to prop up [Syrian President Bashar al-] Assad and try to pacify the population is just going to get them stuck in a quagmire, and it won’t work.” Perhaps, but the Russians and the Iranians appear to have something quite different in mind: They are not trying to pacify the population. They want to ensure that dictator Assad maintains at least a mini-state that controls Damascus and remains connected to Lebanon and the Mediterranean Sea and that, if at some point there is a political process to bring the conflict to an end, the facts on the ground will both preserve their interests and ensure that they will be arbiters of any outcome.

Russian President Vladimir Putin knows how to fill a vacuum. The Iranians are masters at using proxies to preserve their hold in Syria and the conduit to Lebanon — even as they weaken central authority in Iraq. What is interesting is that Qasem Soleimani, commander of the Iranian Quds Force, traveled to Moscow shortly after the nuclear deal with Iran was finalized. No doubt, Putin and Soleimani saw the need to act militarily to shore up Assad’s weakening position and to deal a setback to the non-Islamic State opposition, which was gaining in the north and the south of Syria.

To be sure, both also saw additional utility in ratcheting up their military interventions at this juncture. For Soleimani and Ayatollah Ali Khamenei, Iran’s supreme leader, such a move would validate their revolutionary, “resistance” ideology in the aftermath of agreeing to the nuclear deal with the United States. For Putin, the Russian intervention could be planned while the Obama administration was preoccupied with selling the nuclear deal — and have the added benefit of putting the Russians back on center stage internationally.

Neither the Russians nor the Iranians think they are losing in the region, and neither do the Israelis, Egyptians, Saudis, Turks, Qataris or Emiratis. They may not all like what the Russians are doing, but they see the need to deal with them. Is it possible that they are all wrong and Obama is right?

Maybe, but if our response to what the Russians and Iranians are doing in Syria is limited to increasing our attacks on the Islamic State, which appears to be where we are headed, we will be playing the Russians’ and Iranians’ game. They will continue attacking the non-Islamic State opposition while we target the terrorist group, and we will, unfortunately, appear to be in league with them against the Sunnis. Any hope of having the Sunnis discredit the Islamic State will be lost under these circumstances.

While the president may bemoan hearing only “half-baked” ideas as an alternative, he should be leery of continuing to implement half-measures. So here is one idea that is premised on sharing the burden — something important to Obama — but also guided by the logic of leverage, which is the logic that guides Putin. Quietly go to the Turks, Saudis, Qataris and Europeans and say that it is time to create a genuine safe haven along the ­Turkish-Syrian border. The Turks and the Gulf states have clamored for this, and the Europeans need it to stanch the flow of refugees. Explain that we will do our part to enforce the “no-fly” designation, but only if Europe participates with its air forces, Turkey agrees to police the area on the ground to prevent any Islamic State infiltration, and Saudi Arabia and Qatar agree both to finance the infrastructure for the refugees and accept that all material assistance for training opposition forces in the zone will go through us. Provided they all agree and we are able to work out the terms, we would proceed and the president could tell Putin privately in the kind of language he comprehends: Don’t test the safe haven.

If we are to affect Russian and Iranian behavior in Syria, we have to begin to play by rules they understand. Ironically, it might just get others to follow our lead and make the political solution we seek more likely.