Russian President Vladimir Putin, shown here last week, has signed into law a controversial package of counterterrorism measures. (Alexander Zemlianichenko/AP)

Russian President Vladimir Putin on Thursday signed into law a controversial package of counterterrorism measures, including tougher sentences for extremism and heightened electronic surveillance of Russian citizens, that have provoked condemnation from rights activists here.

Among the critics was Edward Snowden, the former National Security Agency contractor who leaked details in 2013 of U.S. government telephone and Internet surveillance programs. Some measures in the Russian legislation resemble those U.S. programs.

Several of the amendments require telecommunications operators to store recordings of their customers’ phone calls and text messages for six months and order messaging services such as Facebook and Telegram to provide decryption keys to Russia’s Federal Security Service, or FSB.

Others require Russians to inform authorities about potentially grave crimes or their planning, stiffen penalties for re-posting information deemed extremist on the Internet, and require postal employees to inspect packages.

Festival-goers greet Edward Snowden (on screen) during a live-stream interview with the activist group the Yes Men during the Roskilde Festival in Denmark on June 28. (Mathias Loevgreen Bojesen/European Pressphoto Agency)

“#Putin has signed a repressive new law that violates not only human rights, but common sense. Dark day for #Russia,” Snowden wrote Thursday in one of several Twitter messages about the “Yarovaya laws,” named for co-author and former prosecutor Irina Yarovaya.

It was Snowden’s most direct criticism of Putin since he received asylum in Russia three years ago. Opponents have accused him of leaking information to the Russian government and ignoring the country’s repressive Internet policies. Snowden has denied any agreement with Russia and says the U.S. government has annulled his passport and left him stranded.

“People ask if I fear retaliation for my criticism. I do. But it did not stop me from criticizing the @WhiteHouse, and will not stop me here,” he wrote Thursday.

After signing the law, Putin ordered the government to help minimize the costs of data storage, apparently as a concession telecom companies, which complained that compliance was “technically and economically impractical.”

Russia’s Presidential Council on Civil Society and Human Rights called on Putin to reject the laws because of the “unconstitutionality, contradictoriness and legal uncertainty of some of the legal norms contained in them.”

Dmitry Peskov, Putin’s press secretary, told reporters Thursday that “the government will keep a wary eye on the implementation of that law and will take relevant measures on the president’s order in case of any undesirable developments.”

The measures will impose tougher sanctions on mass unrest and limit proselytizing, to representatives of registered religious groups. Pacifist religious organizations, including Jehovah’s Witnesses, complain they have been targeted by laws aimed at violent groups.

Previous versions of the law would have allowed authorities to strip Russians of citizenship for crimes such as terrorism and extremism, and impose bans on international travel. Those amendments were omitted from the final version of the bill, which passed Russia’s parliament on its last day in session.