Turkish President Recep Tayyip Erdogan has vowed to tighten government controls on social media, following alleged insults directed at his family.
Erdogan said that his government is determined to introduce legislation that would force social media companies to establish a legal presence in Turkey.
The requirement would mean social media companies could be held financially accountable and forced to obey the decisions of Turkish courts.
"It is imperative that these channels are brought under control,'' Erdogan told party members in a televised address from the capital, Ankara.
Insults were directed on social media towards President Erdogan's daughter and son-in-law - Minister of Treasury and Finance - when they announced the birth of their fourth child on Twitter.
The country's Interior Minister Suleyman Soylu said a number of "devils" had been detained on Wednesday.
Many Turks rallied in support of the president's family and condemned the insults, including opposition politicians.
But others have expressed concern at Erdogan's threats to social media companies. The hashtag #SosyalMedyamaDOKUNMA (#DontTouchMySocialNetworks) was top trending in the country on Wednesday.
Critics fear the move is aimed at further limiting freedom of speech in Turkey and preventing access to foreign news information.
The Turkish government has long been considering amendments to restrict social networks and has previously blocked access to thousands of websites.
In January, access to Wikipedia was restored in Turkey after a ban of more than two years.
A month later, data from the NetBlocks internet observatory showed that Turkish access was cut to social media platforms including Twitter, Facebook, and Instagram, following an airstrike in Syria.