Soon after Islamist rebels overthrew the authoritarian president of Syria, Bashar al-Assad, a hashtag gathered steam on Egyptian social media: “It’s your turn, dictator.”

The message for President Abdel Fattah el-Sisi of Egypt was unmistakable. But he hardly needed the warning.

Since the ouster of Syria’s longtime dictator on Dec. 8, Egyptian leaders have watched events in the Syrian capital, Damascus, with grim-faced vigilance, knowing well that revolutionary fire has a tendency to spread.

Both countries have had a turbulent history since the Arab Spring uprisings that started in late 2010 and spread across the Middle East.

The Syrian revolt culminated almost 14 years later with Mr. al-Assad’s fall. The Egyptian revolution deposed the country’s longtime authoritarian president, Hosni Mubarak, and saw an Islamist political party come to power in the country’s first free elections. Mr. el-Sisi seized power two years later in a military takeover, and he and like-minded leaders in the Persian Gulf and beyond remain wary of Islamist groups gaining any power in the region, as they just did in Syria.

Days after Mr. al-Assad fled Syria for Russia, Egyptian security forces arrested at least 30 Syrian refugees living in Cairo who were spontaneously celebrating his fall, according to the Egyptian Initiative for Personal Rights, a rights group.

The Egyptian authorities also made it harder for Syrians to travel to Egypt in the aftermath of Mr. al-Assad’s overthrow, requiring most to obtain security clearances first.

Mr. el-Sisi has given unusually frequent addresses in recent weeks to defend his record.

“My hands have never been stained with anyone’s blood, and I have never taken anything that wasn’t mine,” he said in December, a week after Mr. al-Assad fell.

In doing so, he seemed to draw a contrast with the deposed Syrian leader while brushing aside his own human rights record, including a massacre by the Egyptian military forces that he led of what rights groups say were at least 817 people protesting Mr. el-Sisi’s takeover of power in 2013.

Since the rebels in Syria seized power, Egypt has arrested or began prosecuting several people considered political opponents, including the director of a prominent rights group, the wife of a detained political cartoonist and a TikTok user who had been posting videos critical of Mr. el-Sisi. Egypt already was holding an estimated tens of thousands of political prisoners, many of them Islamists.

“Two thousand and eleven is only 14 years away,” said Mirette F. Mabrouk, an Egypt expert at the Middle East Institute in Washington, referring to the year of the Egyptian revolution. The Egyptian authorities, she said, “know that things snowball.”

After years of deepening economic misery across Egypt, Mr. el-Sisi was already in an acutely vulnerable position. Any hint that Egyptians could catch Syrians’ revolutionary fervor spells trouble — not because Egyptians want armed revolt, Ms. Mabrouk said, but because it could take very little for their disgruntlement to explode into protest.

The most visible attempt to capitalize on the moment has come from Ahmed al-Mansour, an Egyptian who left the country to fight with Syrian rebels years ago. After Mr. al-Assad’s ouster, he repeatedly ranted against Mr. el-Sisi online from Damascus.

“You’re worth one bullet,” Mr. al-Mansour said of Mr. el-Sisi in a video posted on X. It was viewed 1.5 million times.

The threat sent Egypt’s TV anchors, who often amplify pro-government talking points on their nightly broadcasts, into an uproar. One host, Ahmed Moussa, called on Syria’s new leaders to act.

“They must tell us if they are with what is happening in the targeting of our country or not,” he warned.

Shortly after his tirade in mid-January, the new Syrian authorities arrested Mr. al-Mansour along with several associates. He was detained on his way to a meeting with the country’s interim defense minister, according to a statement from the anti-Sisi movement Mr. al-Mansour founded.

It is unclear whether Egyptian authorities had pushed for his arrest.

Mr. al-Mansour’s group urged the Syrian authorities to release him, saying that the Egyptian people were exercising their rights against Mr. el-Sisi just as Syrians had done against Mr. al-Assad. His current status is unknown.

But even with Mr. al-Mansour silenced for now, other Egyptians are unlikely to stop complaining.

Many have soured on Mr. el-Sisi after years of economic crises, the most recent of which was triggered by the successive shocks of the wars in Ukraine and Gaza. But the problems are also rooted in government mismanagement and overspending, including on grandiose megaprojects.

With Egypt deep in debt and losing revenue, the currency has crashed, some goods have become difficult to find and inflation has soared.

Such hardships have suffocated a population of about 111 million where nearly one in three already lived in poverty, according to official statistics.

Mr. el-Sisi has tried to shield himself from criticism, saying in a recent speech that the country was already in bad financial shape when he took over in 2013 and that Egypt’s rapid population growth had made it difficult to provide for his citizens. But he had spent years boasting of the prosperity he would bring to Egypt — prosperity that never came, even as he inaugurated a costly new capital city complete with a gleaming presidential palace.

“People are seriously discontented, and therefore he’s trying out there to just tamp things down,” Ms. Mabrouk said.

In the beginning, many hailed the president as a hero and savior for using military force to oust the Muslim Brotherhood, the Islamist political party that won the presidency following the 2011 Egyptian revolution but went on to alienate much of the population.

Mr. el-Sisi spent the ensuing years stamping out the Brotherhood in Egypt, viewing it as a threat to his power. Egyptian authorities prosecuted thousands of Brotherhood members and suspected sympathizers, labeling them terrorists, while others have fled the country.

Even weakened, political Islamists remain a popular target for Mr. el-Sisi and his supporters, who frequently invoke the dangers of political Islam.

So it was unsurprising when the Egyptian authorities sounded a note of caution about the lightning rise of Hayat Tahrir al-Sham, the Islamist rebel group that has taken charge in Syria. The group was once affiliated with Al Qaeda but has disavowed its extremist origins.

Egypt may have had little love for Mr. al-Assad, analysts said, but it had come to prefer the brittle stability he represented to the chaos and conflict that surround Egypt in Libya, Sudan and Gaza.

It has therefore approached relations with the new Syria gingerly.

Unlike other Arab countries, Egypt has not yet held high-level meetings with Syrian officials.

Diplomats in Cairo say Egyptian officials have privately urged other governments to remain wary of Syria’s new leadership and not to lift penalties on the country too quickly. They spoke on condition of anonymity because they were not authorized to speak publicly.

Egypt’s foreign minister, Badr Abdelatty, has called on regional and international partners to ensure that “Syria does not become a source of regional instability or a haven for terrorist groups.”

Mahmoud Badr, an Egyptian pro-government activist who helped foster the anti-Muslim Brotherhood protest movement that paved the way for Mr. el-Sisi’s ascension, said on X soon after Hayat Tahrir al-Sham swept into Damascus that the group and the Brotherhood were indistinguishable.

“It’s all part of one network and no one can convince us otherwise,” he said, citing widely circulated photos that showed the leader of the Syrian group meeting with a prominent Egyptian member of the Brotherhood.

And though anti-Islamist sentiment remains strong among Egyptians, so does anti-Sisi sentiment.

“It comes at a very bad time for Sisi,” said Broderick McDonald, an associate fellow at Kings College London’s International Center for the Study of Radicalization.