MOSCOW — The Russian government in recent weeks has been making use of a new law that gives it the power to block Internet content that it deems illegal or harmful to children.

The country’s communications regulators have required Facebook, Twitter and YouTube to remove material that the officials determined was objectionable, with only YouTube, owned by Google, resisting. The video-sharing site complied with a Russian agency’s order to block a video that officials said promoted suicide. But YouTube filed a lawsuit in Russian court in February saying the video, showing how to make a fake wound with makeup materials and a razor blade, was intended for entertainment and should not be restricted.

Supporters of the law, which took effect in November, say it is a narrowly focused way of controlling child pornography and content that promotes drug use and suicide.

But opposition leaders have railed against the law as a crack in the doorway to broader Internet censorship. They say they worry that social networks, which have been used to arrange protests against President Vladimir V. Putin, will be stifled.