WASHINGTON (AP) — King Abdullah II of Jordan’s visit to Washington this week is testing President Donald Trump’s ability to maintain key Arab alliances while cracking down on immigration from some Muslim countries and possibly moving the American Embassy in Israel to Jerusalem. The next few days could provide an indication if Trump is willing to compromise.

Abdullah, a close US ally, held meetings Monday with Defense Secretary Jim Mattis and Vice President Mike Pence. Trump and the king were to come face-to-face on Thursday at the National Prayer Breakfast, the White House said. The king also planned to meet with US lawmakers this week.

Abdullah’s trip comes as the Trump administration is embroiled in its first major Mideast controversy, sparked by Trump’s executive order temporarily halting all refugee admissions and suspending entry to the US for citizens of seven majority-Muslim countries. Although Jordan isn’t among the seven, even US friends in the region fear Trump’s move could embolden Mideast extremists and contribute to a perception that Washington is at war with Islam — which Trump’s administration insists is not the case.

Trump’s embassy decision looms even larger for Jordan.

US Secretary of Defense James Mattis (L) greets King Abdullah (R) of Jordan during an enhanced honor cordon January 30, 2017 at the Pentagon in Arlington, Virginia. (Alex Wong/Getty Images/AFP)

US Secretary of Defense James Mattis (L) greets King Abdullah (R) of Jordan during an enhanced honor cordon January 30, 2017 at the Pentagon in Arlington, Virginia. (Alex Wong/Getty Images/AFP)

The kingdom, fighting as part of US-led coalition against the Islamic State group, is closely watching to see if Trump fulfills a campaign pledge to move the US Embassy in Israel from Tel Aviv to Jerusalem. Doing so could trigger widespread protests among Jordan’s massive Palestinian population, potentially even jeopardizing Abdullah’s hold on power.

“The US relationship is central to the internal stability of the kingdom,” said Robert Satloff, who runs the Washington Institute for Near East Policy. “This is really part and parcel of the national security fiber of the kingdom, and building this new relationship is really important to the king.”

This month, Jordan warned in unusually brusque terms that moving the embassy would cross a “red line” and could entail “catastrophic” consequences. Information Minister Mohammed Momani told The Associated Press it would be a “gift to extremists,” threatening US ties with Mideast allies.

The embassy was a prime topic of discussion in Abdullah’s meeting with Pence, officials said. The White House said they discussed Abdullah’s “views on potential changes” and how to make progress on Israeli-Palestinian peace. The Jordanian Embassy in Washington said the US “committed to working closely with Jordan” on issues related to the conflict.

Jordan serves as the custodian of Islam’s third holiest shrine and Judaism’s holiest site, located in Jerusalem’s eastern sector. Any US rift with Jordan could spill over to the kingdom’s participation in the fight against IS, a campaign both Trump and Abdullah say they hope to accelerate. During his campaign, Trump pledged repeatedly to move the American Embassy in Israel, a promise former US presidents have made and broken. Since his inauguration, Trump has backtracked slightly, with White House spokesman Sean Spicer saying the administration is only in the “beginning stages of even discussing” such a move.

Although Israel considers Jerusalem its capital, the US and most countries maintain embassies in Tel Aviv. The US says conflicting Israeli and Palestinian claims to Jerusalem must be worked out in peace negotiations.

Israel claims all of Jerusalem, having annexed East Jerusalem after capturing it from Jordan in the 1967 Six Day War, but the Palestinians want the capital of their future state in the city’s eastern sector.

The US relies on Jordan for major military and intelligence support in fighting IS, and the kingdom plays a major role in combating radicalization in the Middle East.

Both Trump and Abdullah say they want close ties. On Twitter, Trump said during the campaign he had “great respect” for Jordan’s monarch. The two spoke by phone shortly after Trump was elected.

Jordan, like most US allies in the region, has avoided criticizing Trump’s temporary ban on refugee admissions and on travel to the US by citizens of Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen.

However, the refugee measure — which indefinitely blocks Syrian refugees — could still trouble Jordan. The Syrian neighbor hosts more than 650,000 refugees from Syria’s civil war and wants other countries to help resettle refugees to ease its burden.

Copyright 2017 The Associated Press.