Jordan's king flew by helicopter to the West Bank on Monday — a rare visit seen as a signal to Israel that he is closing ranks with the Palestinians on key issues, such as a contested Jerusalem shrine. Palestinian President Mahmoud Abbas and Abdullah II met for about two hours, after a red-carpet welcome for the monarch at the Palestinian government compound in the West Bank city of Ramallah. Abbas thanked the king for efforts made on behalf of the Palestinians, including during the shrine crisis, said Abbas spokesman Nabil Abu Rdeneh. Abdullah expressed support for Abbas and the Palestinians, the spokesman said. The monarch's West Bank visit, his first in five years, came at a time of rising Israeli-Jordanian and Israeli-Palestinian tensions over the shrine, known to Muslims as the Noble Sanctuary and to Jews as the Temple Mount. The crisis erupted when Israel installed metal detectors at gates to the Muslim-administered site after Arab gunmen killed two Israeli policemen there in mid-July. The measures triggered protests by Muslims who feared Israel was encroaching on their rights, an allegation Israel has dismissed. Israel removed the devices after a few days, after intervention from the United States, Jordan and others. The step was seen by many in Israel as a capitulation and by Palestinians and the Arab world as a victory. The shrine, a sprawling 37-acre (15-hectare) esplanade rising from Jerusalem's walled Old City, is central to rival Israeli and Palestinian religious and national narratives and has triggered major confrontations in the past. Jordan serves as the Muslim custodian of the site, home to the Al-Aqsa and Dome of the Rock mosques. Jordan's ruling Hashemite dynasty has drawn much of its legitimacy from that role. On Sunday, Abdullah told lawmakers in Jordan that "without the Hashemite custodianship and the steadfastness of the Jerusalemites, the holy sites would have been lost many years ago." "Our success requires one stand with the Palestinian brothers, so that our cause wouldn't be weakened and our rights would be maintained," he said. However, the monarch's role in the standoff with Israel was complicated by a July 23 shooting in which an Israeli guard at the Israeli Embassy in Jordan killed two Jordanians after one attacked him with a screwdriver. The guard was released by Jordan the next day, after a phone call between the king and Israeli Prime Minister Benjamin Netanyahu. A few hours later, the metal detectors were dismantled. The guard's release, though in line with diplomatic protocol, has inflamed Jordanian public opinion, especially after the shooter was given a hero's welcome by Netanyahu. The king blasted the prime minister's actions as "provocative." Israeli authorities have since said they would investigate the embassy shootings, meeting a Jordanian demand. Since the embassy shooting, Abdullah has taken several steps that appeared aimed at appeasing Jordanian public opinion. He has said he would donate $1.4 million to the Muslim administration of the shrine. Separately, Abbas has said his self-rule government in the West Bank will allocate $25 million to improve services for Palestinians in Jerusalem. During the shrine crisis, Abbas said he was suspending security ties with Israel until the metal detectors have been removed. It is not clear to what extent such ties — mainly cooperation between Israeli and Palestinian forces against the Islamic militant Hamas — has resumed.