First, it was “gossip” that supposedly pushed Uganda’s government to introduce a tax on social media use. Several weeks later, the country’s 72-year-old president Yoweri Museveni changed tack, saying officials were introducing the levy to increase domestic revenues. But the ultimate target of this decision wasn’t lost on Ugandans, who understood it for what it was: an attempt to muzzle their growing freedoms online.

Controlling what’s being said online is hardly the prerogative of Uganda. Increasingly, African governments are looking at the internet as a threat and are using a motley of targeted shutdowns, surveillance, and arbitrary legislation to silence digital users. In the world’s least connected continent, dictators—and some democrats—are realizing they not only need the batons or bullets to stave off criticism but could also power off live feeds to undermine the vibrant conversations taking place online.

And these disruptions are having a costly impact: not just on democracy and social cohesion, but on economic growth, innovation, internet openness, net neutrality, and freedom of expression.

Across Africa, the examples are plenty: In Tanzania, bloggers now have to pay authorities over $900 to license their websites. In Egypt, officials have banned calls made over social media apps, blocked hundreds of local and international websites, and called for the launch of a state-owned, Facebook-like platform. In DR Congo, president Joseph Kabila’s administration has used a decades-old law to monitor and censor the internet. Kenya, bedeviled by fake news during its elections last year, recently passed a sweeping law that critics say could stifle press freedom.

And nations including Ethiopia, Chad, Cameroon, Uganda and Algeria have all shut the internet or blocked apps including WhatsApp, Facebook, and Twitter during anti-government protests or crucial elections.

Coming online:

These curtailing practices take place even as getting connected becomes a byword for economic and political progress in Africa. With increasing internet speeds, rising smartphone adoption, growing e-commerce platforms, and improving tech ecosystems, Africa’s internet economy is gradually taking hold. And as incongruous as it sounds, nations are increasingly coming online too, with about 83% of all African governments holding a Facebook account according to Twiplomacy, which advises states on digital strategy. African presidents, including Rwanda’s Paul Kagame, Kenya’s Uhuru Kenyatta, and Uganda’s Museveni all use Twitter to engage their followers and promote their accomplishments.

As the crackdown intensifies, activists are pushing back, resorting to “naming and shaming” nations infringing on digital rights, alerting continental and international organizations including the African Union, and pressing telcos to be more accountable to consumers.

“At least you have to show that you know your rights and are ready to defend them,” says Julie Owono, the executive director of advocacy Internet Sans Frontières, which has uncovered cases of internet throttling or blocks.

Others are also working to bridge the digital divide, teaching users not just critical digital skills but educating them about their rights and how to stay online. This is important, especially in a continent where financing for internet accessibility is low, and where “many think about bread and bed first and then broadband,” says Tope Ogundipe, the director of programs at Nigerian social enterprise Paradigm Initiative.

Yet when all fails, digital activists have responded by getting even with authoritarian states. When Togolese president Faure Gnassingbé’s administration faced protests last year, it cut off the internet and blocked WhatsApp. But under the “Faure Must Go” umbrella, a decentralized group of 5,000 activists worked from both within Togo and in neighboring Ghana to take down government websites including the presidency, the revenue authority, and the national television.

Giving the government a taste of its own medicine was a way not only to pressure them but also “make them understand that it’s not just them who can attack us. We can also attack them,” says Farida Nabourema, a Togolese activist who helped coordinate the effort. “We have to be online.”