Chedly Ben Ibrahim / Demotix / Corbis Following the call of the ruling Ennahda party, dozens of Tunisian supporters gathered outside the Egyptian embassy in Tunis in support of Egyptian President Mohamed Morsi on July 7, 2013

There’s one place that has watched the past two weeks of violence in Egypt with particular nervousness: Tunisia, the country that ignited the entire Arab Spring back in January 2011. With Egypt’s elected President now ousted and in military custody, along with several of his Muslim Brotherhood colleagues, Tunisia’s ruling party finds itself as the only Islamist government in the region. That’s an anxious spot to be, especially when there’s the possibility of fresh revolt or of militants seizing on Egypt’s military intervention as proof that democratic politics is futile. “What happened in Egypt is a real threat to democracy because we saw the overthrow of a legitimate President,” said Mohammed Omar, a member of the political bureau of Tunisia’s ruling Islamic party, Ennahda, the senior partner in a three-party coalition that runs the country, speaking by phone from Tunis. “I don’t think any country is secure now from what happened in Egypt.”

Given the intense battles that have raged on Cairo’s streets since June 30, it’s easy to forget Tunisia’s pivotal role in Egypt’s revolution back in January 2011. One month before Egyptians poured into Tahrir Square to demand Hosni Mubarak’s downfall, Tunisians mounted giant protests against Zine el-Abidine Ben Ali’s 24-year dictatorship, which electrified the region and drove the President from office in just five weeks. When the Egyptian revolution began days later, several protesters carried Tunisia’s red-and-white flag into Tahrir Square, in homage to the revolution that had emboldened them. For months after that, the two countries — one tiny, the other the Arab world’s most populous — seemed to track each other closely: Islamist parties won democratic elections, while secular and religious camps battled over the legal framework for new constitutions.

Yet in one crucial aspect Tunisia and Egypt took very different paths: While Morsi shut out dissidents and strengthened the Muslim Brotherhood’s grip on Egypt, Tunisia’s Ennahda government runs the country in partnership with two smaller secular parties, one controlling the presidency under Moncef Marzouki, and the other in control of the assembly to draft the constitution — crucial to thrashing out how rigidly Islamic the country’s legal system will be. With Egypt racked by chaos and political instability, Tunisians are hoping that their coalition — a delicate arrangement fraught with infighting — might stave off a similar eruption at home. “In Tunisia, we anticipated what happened in Egypt,” Omar says. “We chose to give an opportunity for secular parties to share with us, and that excludes the intervention of the military or anything like that.”

But peace is not totally assured. Tunisia’s Islamist rulers have railed against the Egyptian military’s ouster of Morsi, with Ennahda leader Rachid Ghannouchi calling on Muslim Brotherhood members to stay on Cairo’s streets until Morsi is freed. After Egyptian security forces opened fire on a Muslim Brotherhood gathering on July 8, killing more than 50 people, Ghannouchi issued an enraged statement, saying that “putschist forces committed a massacre against peaceful protesters supporting the legitimate President,” and called on Egyptians to “reject the coup and support the pro-democratic legitimacy front.”

Ghannouchi’s fury of course has had little effect on the situation in Egypt. And instead, some Tunisians believe a similar upheaval to Egypt might be possible, especially with rising dissatisfaction over the government’s seeming inability to improve a tepid economy or to rein in more militant Islamic groups, one of which assassinated a beloved secular opposition leader, Chokri Belaid, last February. “Tunisia does not seem immune to what happened in Egypt,” political analyst Youssef Ouaslati told Reuters on Friday. “The Brothers in Tunisia may face a similar fate, especially in light of an unprecedented rapprochement between divergent political currents in the opposition to remove Islamists from power.” In May, Tunisian police battled to stop protests by the militant Ansar al-Sharia from spiraling into violence; and last week, Marzouki renewed for three months the security forces’ state of emergency powers, which have been in effect since Ben Ali’s downfall.

Meanwhile, Egypt’s mammoth protests that drove out Morsi have galvanized secular activists in Tunisia. Recently, they have formed a new movement, calling itself Tamarod, or “rebel” — the name of Egypt’s mass protest movement that sought to bring down Morsi — and claims to have collected 200,000 signatures calling for the government to dissolve parliament and organize early elections. Perhaps most worrying for Ghannouchi and his Islamist government, Tunisia’s Tamarod has called for mass antigovernment protests on July 25, the anniversary of Tunisia’s independence from France. That echoes the June 30 date Egypt’s Tamarod picked to kick off its anti-Morsi revolt.

Ghannouchi faces added pressure from a new secular political organization called Nidaa Tounes, which has grown rapidly since last year and which wants the government dissolved, much like Egypt’s grassroots campaign that undid Morsi. “Tunisia and Egypt, it’s like a Ping-pong ball,” says Nabil Karoui, head of Nessma TV, a secular network based in Tunis, speaking by phone from there. “We started the revolution, and then it moved there, and then when things arise here, it arises there.” Karoui, who was convicted last year of offending Islam for broadcasting the French-Iranian movie Persepolis, says he believes the violence in Egypt “makes our government and the Islamists very anxious. They are scared that it is coming here.”

Despite that, even some of the Islamists’ fiercest critics seem loath to risk Egyptian-style chaos, if they dare to rock the religious-secular partnership that runs Tunisia. “Our hearts are with Egypt,” Mouldi Riahi, a secular lawmaker told a local reporter last week. “But we do not want Tunisia to be in its shoes.”