Even the night before Narendra Modi accepted the resignation of his education minister, India’s prime minister appeared confident that the largest mass uprising in his 12-year reign would do little to rattle his government. Addressing his “young friends” in a late-night Instagram selfie reel on Friday, he thanked the people - who were busy mobilising en masse and shouting anti-government slogans - for their “thoughtful suggestions.” Less than 24 hours later, Modi, who has fiercely cultivated his strongman image, accepted Dharmendra Pradhan’s resignation. Analysts called it the remarkable humbling of a government that has ruled with almost untouchable impunity since 2014.

Over the past week, a Gen Z movement calling itself the Cockroach Janta party (CJP) mobilised an unprecedented protest after a crucial exam paper leak forced 2 million students to resit the test and was blamed for more than a dozen suicides. Pradhan’s resignation was their first and foremost demand, even as protests expanded into a wider fight for democracy. On Saturday, more people than ever poured into Delhi’s historic Jantar Mantar site, and unrest spread to other cities, including states ruled by Modi’s Bharatiya Janata party (BJP).

The BJP’s powerful IT cell, usually effective at capturing the online narrative, proved no match for the millions of Gen Z memes and reels flooding Instagram, fearlessly insulting Modi and pillorying the government. Modi’s last-ditch Instagram attempt was met with more ridicule. Mainstream TV news channels, widely acknowledged as BJP mouthpieces, initially ignored the protests, then suggested protesters were bankrolled by foreign forces and Pakistani terror groups. In response, protesters exposed their “lies” on social media. When protests escalated, Modi remained conspicuously absent from the airwaves.

“The online space was totally conquered by the protesters and regime-loving media was seriously delegitimised,” said Ashutosh Varshney, a professor at Brown University. “The anger was so comprehensive there was no option left but for Pradhan to go.” Analysts say this is the first time in 12 years the Modi government lost control of the political narrative. “This is a repressive government,” Varshney said. “It wants obedience, it wants no critical discussion and it generates fear. But now the climate of fear has collapsed.”

Pradhan’s resignation could also have implications for Modi’s power over his own cabinet. “Modi knows once you start firing your most loyal ministers, it sets up the incentives for defections,” said political columnist Pratap Bhanu Mehta. The emergence of the cockroaches has reinvigorated not only India’s youth but also opposition parties. The Congress party had its best week in years, and its leader Rahul Gandhi was dramatically dragged away by police outside Modi’s house in support of students.

The next big test comes early next year when Uttar Pradesh, India’s largest and most politically important state, holds elections. The CJP’s founder, Abhijeet Dipke, has some political organising experience but hasn’t revealed his own ambitions. Spokesperson Saurav Das said the movement encourages youth to enter politics: “We need to increase youth participation in politics, because right now it’s controlled by uncles and aunties who are only interested in looking after their own lifestyles.”