Jordan's King Abdullah (R) chats with senior Hamas leader Khaled Meshaal on his arrival at the Royal Palace in Amman January 29, 2012. (YOUSEF ALLAN/REUTERS)

Signaling a thaw in relations, Jordan’s King Abdullah II on Sunday hosted Khaled Meshal, the leader of Hamas, who made his first official visit to the country since his expulsion more than a decade ago in a crackdown on the militant Islamist group.

The visit was part of a Jordanian effort to play a more prominent role in Middle East diplomacy and engage with Islamists who have become a rising political force in the aftermath of revolts that have unseated autocratic leaders across the Arab world.

Hamas, which rules the Gaza Strip, is contemplating relocating its political headquarters from Syria, which has been shaken by a popular uprising against President Bashar al-Assad, long a patron of the Palestinian group’s exiled leadership.

Meshal’s visit to Amman was arranged with the mediation of Qatar, and official Jordanian announcements described him as accompanying the Qatari crown prince, Tamim Bin Hamad al-Thani, in his talks with the king.

Abdullah is a key American ally in the region, and assigning Meshal secondary status appeared to be not only a matter of protocol but also a nod to sensitivities in Washington and in Israel, where Hamas is considered a terrorist organization because of its deadly attacks on Israeli civilians. Jordan signed a peace treaty with Israel in 1994.

Meshal, who heads the political bureau of Hamas, has been based in Damascus since he was deported and his group banned in Jordan in 1999. But he has spent recent weeks moving around the Middle East, effectively abandoning Syria, where the upheaval has led to the departure of senior Hamas officials. Relations between the Syrian leadership and Hamas have been strained by the group’s failure to back the government’s fierce crackdown on the insurrection, which has left thousands dead.

Hamas officials say they have not decided whether or where to move their headquarters, raising speculation that they might be considering a move to Jordan. However, Jordan’s information minister, Rakan Majali, ruled out that possibility and said that normalizing relations with Hamas did not mean that it would be allowed to reopen its offices in the country.

Meshal, who was joined by his deputy and four senior Hamas officials, said after the meeting that his group would “respect the limits and ceilings of any relationship determined by the two sides.” He added that Hamas was eager to establish “unique relations” with Jordan, and he gave assurances that his group “seeks the security of Jordan and its stability.” He did not say whether Hamas had asked to open an office in Amman.

In remarks to his visitors that bluntly contradicted Hamas’s advocacy of armed action against Israel, Abdullah asserted that “negotiations between the Palestinian and Israeli sides with the support of the international community is the only way for the Palestinian people to recover its rights,” according to a statement from the royal court.

Analysts said that patching up relations with Hamas could give Abdullah additional leverage in mediating between Israel and the Palestinians, and between Hamas and the rival Palestinian faction Fatah. The two groups are struggling to carry out a reconciliation accord signed last year.

Jordan hosted exploratory talks this month between Israel and the Palestinians in an effort to restart stalled peace negotiations, and Abdullah made a rare trip to the West Bank in November to show support for Palestinian Authority President Mahmoud Abbas, who is the leader of Fatah. The visit was meant to signal that despite the overture to Hamas, Jordan continued to view the Palestinian Authority as the representative of the Palestinians.

Radwan Abdullah, a Jordanian political analyst, said the shifts brought by the Arab Spring had given Jordan a chance to play a mediating role previously filled by Egypt, now preoccupied with its own political turmoil. “The absence of Egypt from the scene has left a vacuum and an opportunity for Jordan,” he said. “Also, the likely collapse of the Syrian regime and the consequent decrease in the influence of Iran are an opportunity for diplomatic activity.”

“One can argue that by having relations with Hamas, we can moderate its behavior,” Abdullah added.

Other analysts noted that the rapprochement with Hamas could serve the king internally, easing relations with the Muslim Brotherhood in Jordan, which has been leading weekly protests calling for curbs on the king’s authority.

“This can help on the street,” said Randa Habib, a commentator and journalist.

Meshal holds a Jordanian passport but was accused of “illicit and harmful activities” when he was expelled along with other Hamas officials. In recent years, he has been permitted into Jordan twice on humanitarian grounds — in August 2009 to attend his father’s funeral and in October to visit his ailing mother.

After meeting with the king Sunday, Meshal pronounced it “a good beginning.”