ANKARA, Turkey - A high school student who was jailed for allegedly insulting Turkey's leader was released from custody Friday after his arrest caused uproar and intensified fears that Turkey under President Recep Tayyip Erdogan is lurching toward more authoritarian rule.

The boy, 16, was arrested Wednesday for allegedly calling Erdogan a thief, a day after he took part in a small left-wing student rally commemorating the death of a pro-secular army officer slain by Islamists 84 years ago.

His arrest at his Meram Technical and Vocational school in Konya, central Turkey, sparked an outcry, with opposition parties denouncing it as the latest example of the government's descent toward authoritarianism and its crackdown on free speech and dissent.

It is a crime in Turkey to insult the president and others have been arrested on such charges before, but it was the first time a minor has been detained. Dozens of lawyers volunteered to defend the teen and petitioned for his release. At least three students were briefly detained during a protest on Wednesday to denounce his detention, Cumhuriyet newspaper reported.

It wasn't clear if the boy's early release was connected to the huge publicity of the case. Officials insist Turkey's judiciary is independent of the state and it is not uncommon for Turkish detainees to be released from custody quickly.

Erdogan, who has dominated Turkish politics for the past decade as prime minister and as president since his election in August, was long regarded as a champion of democratic reforms. More recently, the Turkish leader has been accused of steering Turkey away from democracy by cracking down on protests, suppressing media freedoms and increasing police powers.

The boy, who can only be identified by his initials M.E.A. because of Turkish laws that protect the identity of minors, made a speech during the rally in which he said the students didn't regard Erdogan as the president, but as the "thieving owner of the illegal palace," according to court papers seen by AP.

He was refering to a government corruption scandal that has implicated members of Erdogan's family, as well as a 1,150-room presidential palace in Ankara that Erdogan inaugurated in October.