CAIRO (Reuters) - Saudi King Salman’s trip to Egypt was meant to display the strength of ties between the two allies. But Cairo’s transfer of two Red Sea islands to Riyadh during the visit stung Egyptian pride and drew criticism of what some saw as excessive Saudi influence.

Egyptian President Abdel Fattah al-Sisi (R) and King Salman of Saudi Arabia shake hands during the reception ceremony in the Egyptian Presidential Palace in Cairo, Egypt April 7, 2016 in this file handout courtesy of the Egyptian Presidency. REUTERS/The Egyptian Presidency/Handout via Reuters/Files

The visit was meant to bury claims that diverging priorities in Yemen and Syria had damaged relations and demonstrate that Egypt and Saudi Arabia were vital to each other’s security.

But after five days of official obsequiousness towards the 80-year-old monarch and no sign of any direct Saudi aid money, Saturday’s news on the islands overshadowed the visit’s original purpose.

Outraged Egyptians accused their once-popular president, Abdel Fattah al-Sisi, of giving up land to curry favor with the Saudis.

Cartoons on social media showed the Sphinx in a traditional Gulf Arab headdress while the front page of Al Maqal newspaper asked: “Are we living the years of the Saudi Republic of Egypt?”

On Twitter, the hashtag “I feel like selling what to Saudi Arabia” trended on Tuesday, with commentators suggesting Egypt flog everything from self-serving lawmakers to Sisi himself.

Beyond the trip’s public relations debacle, Sisi faces uncomfortable questions about the future of relations between the two countries as Saudi largesse is shrinking and Egypt appears to have little to offer in return.

Egypt has struggled to get its economy back on track since the 2011 uprising that toppled Hosni Mubarak.

Saudi Arabia has showered Egypt with billions of dollars in aid since 2013, when Sisi ousted elected President Mohammed Mursi of the Muslim Brotherhood and banned the Islamist movement, which Riyadh opposes.

But falling oil prices have forced Saudi Arabia to overhaul its economic policies and rethink priorities. Early in the royal trip, a Saudi businessman told Reuters there would be no more free money for Egypt. [nL5N17B4P0]

After all, despite the billions Saudi Arabia and its Gulf allies have provided bail Egypt out, Sisi took only a limited role in the Saudi-led war in Yemen and disagrees on key aspects of the war in Syria.

With Middle East in turmoil, the two countries still need each other, analysts agree, but are running out of ways in which they can help each other.

Egypt needs Gulf Arab money to keep itself afloat and the controversial decision to hand back the islands should be seen in that context, said Amr Adly, nonresident scholar at the Carnegie Middle East Center.

“We can expect things that are very desperate. And giving up the islands is already very desperate,” he told Reuters.

REGIONAL SUCCESS, DOMESTIC DEBACLE

Saudi and Egyptian officials said the uninhabited islands of Tiran and Sanafir belong to the kingdom and were only under Egyptian control because Saudi Arabia’s founder asked Egypt in 1950 to protect them.

But the agreement to hand them over, which still needs ratification by Egypt’s parliament, caused consternation among many Egyptians, who were taught in school that the islands were theirs.

As the furor filled newspapers and airwaves, Sisi invited a group of parliamentarians, ministers and opinion-formers to the presidential palace to reassure them that he would “not sell our land to anyone and would not take land from anyone.”

In a speech, Sisi said Egypt did not want to cause problems with Saudi Arabia by refusing to return its land and repeatedly beseeched his audience to stop questioning the move.

“I’m not taking this issue personally at all ... but please let’s not talk about this issue again,” he said.

But even Egyptians who were willing to accept the islands as Saudi property were upset that Israel was consulted in advance -- the islands are entangled in Egypt’s 1979 peace deal with Israel -- but the Egyptian people and parliament were not.

The announcement was buried at the bottom of a cabinet statement issued late on Saturday, giving the impression that the government had hoped no one would notice.

“What hurts most is the phone call to Tel Aviv that came before everything, and these massive headlines in the most important newspaper in Egypt reassuring Israel before explaining anything to the Egyptian people,” prominent journalist Yosri Fouda wrote on his Facebook page.

The next day, King Salman visited parliament, where lawmakers waved the Saudi flag and repeatedly interrupted proceedings with thunderous applause and impromptu poetry recitals. Above the parliament building, next to the Egyptian flag, fluttered the green banner of Saudi Arabia.

Al Masry Al Youm newspaper counted the times lawmakers clapped in the 15 minutes the king was in the house -- 23.

The spectacle added to a general sense among Egyptians that economic mismanagement and reliance on Saudi aid had left them too beholden to their neighbor.

For the Saudis, at least, the king’s visit achieved its objectives.

The extraordinary length of his stay and engagements that included a meeting with the Coptic Pope and a visit to Cairo University, along with $4 billion in private sector investment pledges, reinforced the message that ties were close, though perhaps uncomfortably close for some Egyptians.

“He basically established to the region that Riyadh and Cairo stand shoulder to shoulder even if they don’t agree on certain issues and that disagreement on certain issues may be annoying but not to the extent that it is upsetting the relationship in a disturbing fashion,” said H.A. Hellyer, senior nonresident fellow at the Atlantic Council.

“The visit was a failure in terms of Egyptian public opinion because of the islands issue ... But it’s dubious to think that upset is going to snowball.”