WASHINGTON - US President Donald Trump, in his final weeks in office, announced the fourth Arab-Israeli agreement in four months on Thursday. In a related major policy shift, the United States agreed to recognize Morocco’s claim over the long-disputed Western Sahara region as part of the deal. In exchange Morocco has agreed to normalize relations with Israel.

Trump said Israel and Morocco would restore diplomatic and other ties, including the immediate reopening of liaison offices in Tel Aviv and Rabat, the eventual opening of embassies and joint overflight rights for the two nations’ airlines.

The agreement adds to Trump’s Mideast legacy just as Joe Biden prepares to assume the presidency in January with an eye toward revamping America’s policies in the region, from Israel to Iran, Iraq and beyond. With Israel, Biden has pledged to return to a more traditional U.S. position, particularly regarding the Palestinians and their aspirations for statehood.

In recognizing Morocco’s claim over Western Sahara, Trump noted that Morocco had been the first country to recognize the United States as an independent nation just a year after the U.S. declared its independence from Britain in 1776.

The White House said Trump and Morocco’s King Mohammed VI had agreed that Morocco would “resume diplomatic relations between Morocco and Israel and expand economic and cultural cooperation to advance regional stability.”

“Another HISTORIC breakthrough today! Our two GREAT friends Israel and the Kingdom of Morocco have agreed to full diplomatic relations – a massive breakthrough for peace in the Middle East!” Trump tweeted.

In a statement, the palace in Rabat said the king had promised Trump he would facilitate direct flights to transport Jews of Moroccan origin and Israeli tourists to and from Morocco and re-open the liaison offices, which had been closed in 2002.

Morocco is the fourth Arab nation to recognize Israel as the Trump administration seeks to expand a diplomatic framework that began over the summer with an agreement between the Jewish state and the United Arab Emirates.

Bahrain and Sudan have followed suit and administration officials have also been trying to bring Saudi Arabia into the grouping.

All these countries are geographically far removed from the Israeli-Palestinian conflict, making it easier to strike deals with Israel and the U.S. for their own particular interests. Morocco also has close ties with Saudi Arabia, which has given its tacit support to the normalization process with Israel, even at a time when peacemaking with the Palestinians is at a standstill.

Morocco, a country with centuries of Jewish history, has long been rumored to be ready to establish ties with Israel.

Before Israel’s establishment in 1948, Morocco was home to a large Jewish population, many of whose ancestors migrated to North Africa from Spain and Portugal during the Spanish Inquisition. Today, hundreds of thousands of Israeli Jews trace their lineage to Morocco, making it one of the country’s largest sectors of Israeli society. A small community of Jews, estimated at several thousand people, continues to live in Morocco.

King Mohammed VI of Morocco telephoned Mahmoud Abbas. President of the Palestinian Authority, to reassure him that Morocco’s position vis-a- vis the Palestinian cause has not changed and will always support a two state solution in the Middle East.