ISTANBUL — Turkish lawmakers passed a bill late Wednesday restricting access to social media platforms for children under 15. President Recep Tayyip Erdogan must accept the bill within 15 days for it to become law.

The bill will force social media platforms to install age-verification systems, provide parental control tools and require companies to rapidly respond to content deemed harmful. Under the law, digital platforms such as YouTube, TikTok, Facebook, Instagram and others must block children under 15 from opening accounts and introduce parental controls to manage their access. Online game companies must appoint a representative in Turkey to ensure compliance with the new regulations. Potential penalties under the law include internet bandwidth reductions and fines imposed by Turkey's communications watchdog.

"We are living in a period where some digital sharing applications are corrupting our children's minds and social media platforms have, to put it bluntly, become cesspools," Erdogan said in a televised address Monday.

The opposition Republican People's Party objected to the approach. "Children should be protected not with bans but with rights-based policies," the party said.

The measure followed an attack one week before the bill's passage, when a 14-year-old boy killed nine students and a teacher at a middle school in Kahramanmaras, southern Turkey. Police are investigating the online activity of the perpetrator, who died, to uncover his motivation for the attack.

Other countries have taken similar steps to limit minors' access to digital platforms. In December, Australia began restricting social media access for children under 16 by revoking access to about 4.7 million accounts identified as belonging to children. Indonesia began last month implementing a regulation banning children younger than 16 from accessing digital platforms that could expose them to pornography, cyberbullying, online scams and addiction. Spain, France and the United Kingdom are taking or considering measures to restrict children's access to social media.