The North African country normalized its ties with Israel in December 2020, part of a series of deals known as the Abraham Accords by the administration of then-US President Donald Trump.
In exchange, Rabat won a key concession from Washington: recognition of its sovereignty over the disputed Western Sahara, where the Polisario movement seeks independence.
But the move was at odds with a strongly pro-Palestinian public mood in Morocco.
A case in point is the royal palace's reaction after the opposition Islamist Justice and Development Party (PJD) "deplored" the Foreign Minister Nasser Bourita for allegedly defending Israel publicly, even as it commits "criminal aggression against our Palestinian brothers".
Rabat regularly reiterates its commitment to Palestinian rights, and the king chairs the international Al-Quds committee, which works to preserve the "Arab-Muslim character" of Jerusalem.
Moroccan journalist and writer Jamal Amiar argues that "having relations with Israel and supporting the Palestinian cause are not mutually exclusive if we defend the two-state solution."
Rabat officially supports the establishment of a Palestinian state in the West Bank and Gaza, with east Jerusalem as its capital.
Since the 2020 deal, Morocco's ties with Israel have developed fast, with Rabat buying advanced drones and other military equipment as well as cybersecurity products.
Amiar said Rabat's "partnership with Israel is based on common security interests and long-standing relations that have helped build trust".
Moroccan-Israeli cooperation is growing in other areas too.
Bilateral trade grew by a third in 2022, while some 200,000 Israelis visited Morocco, according to official figures.
Some 700,000 Israelis are of Moroccan descent, and many have maintained strong ties.
But the rise of ultra-nationalist Israeli parties, which brought veteran hawk Prime Minister Benjamin Netanyahu back to power in December, has threatened to undermine deeper ties.
Israeli Finance Minister Bezalel Smotrich's comment this month that "there are no Palestinians" sparked criticism, including from Israel's ally Washington.
Bourita responded by saying that "Morocco rejects any attitude that could have a negative impact".
Amiar admits that "any prolonged deterioration in relations between Israelis and Palestinians on the ground, in the West Bank or in Gaza, can only negatively impact public opinion on Israeli-Moroccan relations."
Abouddahab agreed.
"Moroccan society at large will not support normalization that could harm the Palestinian cause," he said.
Reflecting the challenges, the Negev Summit has been postponed; a forum in Morocco that was due this month to bring together foreign ministers from Israel and four Arab nations - Bahrain, Egypt, Morocco and the United Arab Emirates - as well as the United States.
"In this context of turbulence, aggravated by a complicated situation in the Middle East... it's hard to predict what will happen," Abouddahab said.
RABAT - Morocco is struggling to balance its alliance with Israel with support for the domestically popular Palestinian cause, an increasingly complex challenge with Israel ruled by its most right-wing government ever.