If it’s tough enough for media pundits to keep up with President Donald Trump’s flip-flopping on domestic politics, then the task of reading the president’s stand on key foreign issues is even more difficult. Jordan, one of America’s closest Middle Eastern partners, has been trying to cope with Trump’s sudden swerves on Syria, Israel-Palestine, and the war on ISIS. At times, the usually reserved Jordanian diplomacy was taken off-guard, forced to recalibrate, and even walk back on certain positions as a result of the president’s rhetoric.

King Abdullah has already met Trump twice in the span of four months in an effort to update the president on the intricate nuances of complex issues, such as the stalled peace process between Israel and the Palestinians and the centrality of the two-state path to any final settlement. For Jordan, Trump’s election rhetoric on relocating the U.S. embassy to Jerusalem and his apparent departure from decades-old American policy on Israeli settlements and the two-state solution, represented an existential challenge for the kingdom. Jordan’s unique relationship to the Palestinian issue had to be explained to the new master of the White House. On the face of it, the king appeared to have succeeded in ameliorating Trump’s initial stands. But then again, Trump has become notorious for reversing his positions overnight.

Take the recent Trump meeting with Palestinian President Mahmoud Abbas at the White House, for example. It was hailed as a victory for the beleaguered Palestinian leader. He had not set foot in Washington for almost four years, but was greeted warmly by Trump. While committing himself as a mediator to achieve “terrific” peace between Israel and the Palestinians, the U.S. president refrained from mentioning the highly relevant and controversial term of “Palestinian state” during his press conference with Abbas. So, for Jordanians and Palestinians alike, the U.S. administration’s position on the Arab Peace Initiative (API), which was re-affirmed by Arab leaders meeting in Jordan in March as the foundation for a comprehensive peace with Israel and the two-state solution, remain vague.

Another challenge for Jordan has to do with Syria. Despite calling for the departure of President Bashar al-Assad after the Syrian uprising erupted in 2011, Jordan’s position quickly adapted to the settling political reality and remained consistent henceforth in calling for a peaceful political solution to the Syrian crisis. At the same time, while never publicly admitting it, Jordan helped train and arm elements of the Free Syrian Army in southern Syria in collaboration with the United States. A special multi-national operations room was created in Amman to coordinate and provide logistical support to moderate Syrian rebel factions.

But the arrival of Trump required that Jordan revisit its Syria strategy, especially in the strategic southern Syria. Initially Trump and key aides announced that the removal of Assad was no longer a U.S. concern, and that America’s priority in Syria centered on defeating ISIS and containing Iran’s presence. Accordingly, Jordan softened its tone toward the Assad regime, declaring on more than one occasion that its support for rebel forces in southern Syria was directed at preventing ISIS and other terrorist elements from moving close to the kingdom’s northern borders. Furthermore, it worked with the Russians to deliver most of the moderate groups in southern Syria, over which it had sway, to the Astana talks. And in addition, it said that it will not open its border crossings with Syria unless and until the Syrian regular army takes over on the opposite side.

But then came the chemical attack in Idlib, allegedly carried out by regime aircraft, a day before Abdullah and Trump met at the White House on April 7. Trump’s language at the joint press conference had changed completely. He called for Assad’s removal and vowed to retaliate. At dawn, the United States fired a barrage of cruise missiles at a Syrian airbase. Jordan’s Foreign Minister Ayman Safadi tweeted almost immediately that the strike was “necessary and appropriate response.” The following weeks witnessed renewed Jordan-Syria tensions and verbal attacks.

In an interview with The Washington Post on April 6, the king hinted that Jordan was ready to take military action north of its borders, saying that “non-state actors from outside coming toward our border are not going to be tolerated.” He also pointed to the presence of Iranian Revolutionary Guards not far from Jordan’s borders. In the days that followed, a number of reports appeared in the Arabic and foreign press claiming that the United States had deployed Special Forces along the northern Jordanian border in preparation for an imminent joint American-British-Jordanian operation inside southern Syria. Russia said it was asking for U.S. clarifications, and Assad attacked the kingdom for its submission to American demands and reiterated claims that Jordan was planning a military operation inside southern Syria.

In a rare reaction, Jordan’s government spokesman lambasted Assad, while local commentators rebuked him for questioning the kingdom’s independence and sovereignty. But it was not until April 26 that King Abdullah brushed aside reports that Jordan was about to get involved in a military operation inside Syria. He told local media figures that while developments in Syria will not be allowed to threaten Jordan, the kingdom will defend itself from any threats, “without the need to have a role for the army inside Syria.”

The shift in Jordan’s position was most probably necessitated by an ambiguity and hesitance on the U.S. side, and growing local opposition for military involvement in Syria. Despite the king’s denial, Jordan remains worried about the growing presence of ISIS militants and proxy groups on the Syrian side of the border. While an outright military intervention is ruled out for now, Jordanian Special Forces remain active with their American and British counterparts, at least in theal-Tanaf base near the Jordan-Syria-Iraq borders where ISIS fighters waged a failed attack on April 10.

Jordan’s stand was recalibrated again when Trump made another flip-flop on Assad, whom he had earlier called a “butcher,” when he reportedly told U.N. Security Council ambassadors on April 25 that the future of Assad was “not a deal breaker” in negotiations on ending the war.

That prompted Jordan to dispatch Safadi to Moscow on April 29 to underline the classic position that only a political solution can work, and that both Russia and the United States must cooperate to hammer out a solution. And even though Jordan attended the latest Astana talks as an observer, it declined to commit to the May 5 agreement to create de-escalation zones in Syria as it waited for a formal U.S. position on the deal.

Whether it is on Syria or Israel-Palestine, Amman is nervously analyzing the shifting positions by Trump. Under President Barack Obama, Jordan was able to chart a more consistent policy, often described as holding to a precarious middle course. Now with a mercurial and moody Trump, walking the tightrope for Jordan has never been more difficult.