CAIRO — Of the many obstacles Egyptian salvage crews faced in freeing the giant ship blocking the Suez Canal last week, there was this invisible one: a low expectation of Egypt's ability to fix its own problems — a perception shared by many of their own countrymen.

 “Our main challenge was the one against ourselves because we wanted to make Egyptians happy,” said Magdy Gamal, 30, a tugboat captain. “There was a lot of talk about foreign assistance and about bringing an entire foreign crew to manage the process. We wanted to prove that Egypt could achieve this.”

And prove they did.

 For the past week, Egyptians have been celebrating the dislodging of the Ever Given and saving global trade with a rare outpouring of pride on social media and in conversations across the capital. Government media have praised President Abdel Fatah al-Sissi for refloating the massive cargo carrier with some Egyptians noting similarities to the way President Gamal Abdel Nasser was celebrated when he nationalized the Suez Canal in 1956.

True, many Egyptians felt a collective sense of pride during last weekend’s Pharaohs’ Golden Parade, a magnificent transfer of 22 mummies along Cairo’s streets to a new museum that was streamed globally. And they feel the same whenever they watch Egyptian soccer star Mohamed Salah play.

 But there have been few instances in recent memory in which Egypt’s actions helped stave off a global economic crisis and billions of dollars in losses.

And this was particularly sweet because so many doubted that Egypt could free the ship quickly.

Egyptians and foreigners dismissed the Suez Canal workers’ abilities. Experts predicted that the dislodging would take weeks, shattering the global economy. There were reports of a U.S. Navy team coming to the rescue as well as other foreign actors taking over the salvage operations.

Memes poking fun of the efforts spread across Egypt and the world, “even by some of our friends,” said Eslam Negm, 32, a crew member on one of the tugboats.

“So much of Egypt’s potential is so regularly repressed that when Egyptians get to see it on display, it’s a really exciting moment,” said Timothy Kaldas, a policy fellow at the Tahrir Institute for Middle East Policy. “Unfortunately, decades of narratives of underestimating Egyptians have convinced a lot of Egyptians themselves that there might be something wrong with the people.”

It’s not uncommon to hear Egyptian elites denigrate the nation’s working class as lazy, inefficient, uncommitted, even dishonest. In Cairo’s affluent enclaves, many prefer hiring Asian or African migrant workers for housekeeping and other menial jobs, viewing them as more efficient.

The “bigotry of low expectations” has a long past, Kaldas said, especially when it comes to the Suez Canal. After Nasser nationalized the vital waterway, both the British and the French expected Egypt to fail in operating it and request their help. But much to their surprise, the Egyptians had learned how to run the canal, and shipping continued unhindered.

Nowadays, there is an “inherent Western, or almost white supremacy, that assumes that it is foreigners who have to solve problems in Egypt or are the ones capable, efficient and functional,” Kaldas said. “Unfortunately, this idea has a really long and dark history that dates back to the early post-colonial period in Egypt.”

Successive Egyptian governments have perpetuated such low expectations of Egyptians, analysts said. A corrosive cocktail of poor governance, corruption, authoritarianism and bureaucracy has deterred innovation. Egyptian firms, many with links to the regime, are often poorly managed and nepotistic, diminishing experience and talent.

 As a result, millions of highly trained Egyptians have left to find opportunities abroad. And they have succeeded to such an extent that remittances last year were $29.6 billion, more than five times the Suez Canal’s $5.61 billion in revenue and more than double tourism revenue in 2019, Kaldas said.

 “So many Egyptians who leave Egypt excel: winning [Nobel] prizes, presidents of universities, and so on . . . but their home country stifled their talent and ingenuity,” Bessma Momani, a professor at the University of Waterloo in Ontario tweeted last week.

 The highly experienced Egyptian salvage crews did not expect the flood of doubts and second-guessing that grew with each day the Ever Given remained wedged in the canal. Many of the workers had grown up on the Suez Canal, with fathers and grandfathers working the vital waterway.

 Adding to the pressure was the Sissi government, which depicted the struggle to free the ship in nationalist terms, describing it as a patriotic duty.

 “We knew it would take time, but we knew sooner or later it would be free,” said Badr Ramadan, a senior crew member on one of the tugboats. “We are highly trained and very qualified. We were prepared for this.”

 But even today, many Egyptians, Arabs and Westerners don’t give full credit to the Egyptian crews who worked day and night to dislodge the ship. On social media, countless posts have argued that the Ever Given would not have been freed if a powerful Dutch tugboat — with stronger pulling power than any of the Egyptian tugs — had not arrived to help.

 “We can’t deny the role of the Dutch boat,” Gamal said. “But people said the ship didn’t move without its help. However, what did 80 percent of the work was the dredger.”

One of the operation’s most important dredgers, which scooped up the sand under the Ever Given, was the Mashhour, a 31,000-horsepower machine owned and operated by Egypt that was like an underwater vacuum. Nine Egyptian tugboats worked with the Dutch tug, and later an Italian one, to dislodge the ship.

 Even with some external involvement, it was Egypt’s Suez Canal Authority that ultimately contracted the Westerners, said Kaldas, adding that if the operation had taken longer, the world would have blamed Egypt, not the foreigners.

When the Ever Given started moving again, the crew of the Mashhour dredger took a selfie video in which they chanted in Arabic, “Mashhour is number one.” The video quickly sped across the social media universe, through the feeds of countless Egyptians.

 By then, low expectations had given way to pride and confidence in their countrymen.

 “The workers and engineers of the Suez Canal should be celebrated in media,” tweeted Ibrahim Fayek, a television sports anchor. “Our men and heroes in every field have to have the spotlight. What they did is a great thing and calls for pride in them.”

Even Sissi’s opponents and critics applauded the government for getting the ship refloated and salvaging Egypt’s reputation in the world.

And for some Egyptians, the Suez crews have inspired them to deal with the inequities they face daily in their country — as well as the low expectations.

 “I learnt a lot from the crisis of the wedged ship at Suez Canal,” Ayman El-Zarka, a doctor, wrote in a Facebook post. “I learnt to believe in myself and work with what I have in my hands, even if it is not much. I learnt to start now and not tomorrow and wait for no help even if the whole world ridiculed me or belittled me.”

 “I learnt that ‘I can.’ ”

Heba Farouk Mahfouz contributed to this report.