President Muhammadu Buhari has criticised a controversial social media bill that is currently being debated in the senate. The Act to Prohibit Frivolous Petitions and other Matters Connected Therewith has stirred outrage as many believe it is an attempt to curb freedom of speech and target government critics. It passed a second reading at the senate earlier in December.

"President Muhammadu Buhari has reiterated the commitment of his administration to the protection of free speech in keeping with democratic tradition," the president's assistant on media and publicity, Garba Shehu, said in a statement. "But he is not averse to lawful regulation, so long as that is done within the ambit of the constitution which he swore to uphold. The president said free speech is central to democratic societies anywhere in the world. The president explained that without free speech, elected representatives won't be able to gauge public feelings and moods about governance issues."

Shehu said that Buhari reassured the public that the senate was democratic. However, the senate would continue to discuss the bill which, according to some senators, would tackle frivolous petitions and protect honest civil servants.

If the bill becomes law, people who "intentionally propagate false information that could threaten the security of the country or that is capable of inciting the general public against the government through electronic message" could be jailed for up to seven years and fined up to 5m Naira ($25,000; £16,000).

Nigerian citizens have taken to social media to vent their outrage over the bill under the hashtag#NoToSocialMediaBill. People argued that such a law would punish critics of the government and lawmakers, who were frequently attacked by the public for their high salaries, perceived lavish lifestyles and their involvement in corruption scandals.

The bill is being sponsored by Senator Bala Ibn Na'allah, from President Buhari's party All Progressive Party (APC). In a document obtained by The Vanguard, Na'allah said the bill did not aim to curb criticism of the government, but aimed to make sure petitions were accompanied by affidavits from the High Court of a state or the Federal High Court.

However, Human Rights Watch warned that the proposed law was designed to muzzle free speech and could affect more than 15 million Nigerians who were active on social media. Socio-Economic Rights and Accountability Project (Sepa) filed a petition against the bill and said in a statement the UN Special Rapporteur was considering the appeal.

Nigeria up close: Check out our Flipboard magazine