ISTANBUL—Turkish Prime Minister Recep Tayyip Erdogan rode around Google Inc. headquarters last spring in the company's self-driving car, tried on Google Glass eyewear and vowed to keep digitizing the economy in the country he has ruled since 2003.

Since then, the 60-year-old Mr. Erdogan has turned his democratically elected government into one of the world's most determined Internet censors.

His political party passed laws letting him shut down websites without a court order and collect Web browsing data on individuals. He put a veteran spy in charge of Turkey's telecommunications regulator.

He also has blocked dozens of websites. Twitter Inc. was banned for two weeks in late March and early April, and Google's YouTube video-sharing service has been dark since March 27. An opposition newspaper columnist and academic was sentenced Tuesday to 10 months in jail for a tweet that insulted the prime minister, while 29 defendants are on trial on allegations that include using tweets to organize protests and foment unrest last year.

"Let people say whatever they want, we will take care of this ourselves," Mr. Erdogan said after blocking Twitter.