* Turkey asked Twitter to reveal user identities -official
* Move comes after weeks of anti-government protests
* Turkey shut down YouTube for over two years in 2008
Turkey said on Wednesday it had asked Twitter to set up a representative office inside the country, which could give it a tighter rein over the microblogging site it has accused of helping stir weeks of anti-government protests.
While mainstream Turkish media largely ignored the protests during the early days of the unrest, social networking sites such as Twitter and Facebook emerged as the main outlets for Turks opposed to the government.
Prime Minister Tayyip Erdogan has described sites like Twitter as a "scourge" - although senior members of his party are regular users - saying they were used to spread lies about the government with the aim of terrorising society.
Police detained several dozen people suspected of inciting unrest on social media during the protests, local reports said.
"We have told all social media that ... if you operate in Turkey you must comply with Turkish law," Transport and Communications Minister Binali Yildirim told reporters.
"When information is requested, we want to see someone in Turkey who can provide this ... there needs to be an interlocutor we can put our grievance to and who can correct an error if there is one," he said.
While Ankara had no problems with Facebook, which had been working with Turkish authorities for a while and had representatives inside Turkey, Yildirim said it had not seen a "positive approach" from Twitter after Turkey had issued the "necessary warnings" to the site over the matter.
"Twitter will probably comply too. Otherwise this is a situation that cannot be sustained," he said, without elaborating, but stressed the aim was not to limit social media.
An official at the ministry, who asked not to be named, said the government had asked Twitter to reveal the identities of users who posted messages deemed insulting to the government or prime minister, or which flouted people's personal rights.
It was not immediately clear whether Twitter had responded.
In a statement, Facebook said it had not provided user data to Turkish authorities in response to government requests over the protests and said it was concerned about proposals internet firms may have to provide data more frequently.
Turkey's interior minister had previously announced the government was working on new regulations that would target so-called "provocateurs" on social media but there have been few details on what the new laws would entail.
One source with knowledge of the matter said the justice ministry had proposed a regulation whereby any Turk wishing to open a Twitter account would have to enter their national identification number, but that this had been rejected by the transport ministry as being technically unfeasible.
Twitter last year introduced a new feature called "Country Withheld Content", that allows the service to narrowly censor tweets considered illegal in one specific country, causing some concern among users.
The website implemented the feature for the first time in October in response to a request by German authorities, blocking messages in Germany by a right-wing group banned by police.
Turkey last year said it had won a long-running battle to persuade YouTube to operate under a Turkish web domain, giving Ankara more control over the video-sharing website and requiring the firm to pay Turkish taxes.
Turkey banned the popular website for more than two years in 2008 after users posted videos Turkey deemed insulting to the republic's founder, Mustafa Kemal Ataturk.
Rights groups have long pressed Turkey to reform strict Internet laws and analysts have criticised the ease with which citizens and politicians can apply to have a site banned.
Turkey cites offences including child pornography and insulting Ataturk to justify blocking websites.
But Turkish users have increasingly turned to encryption software to thwart any ramp up in censorship of the Internet.