The boy, Mehmet Emin Altunses, was released following a complaint by his lawyer over his arrest in the central city of Konya.
He was met by his parents as he left the main courthouse building in the city but defiantly declared his political activism would continue, the CNN-Turk channel reported.
"There is no question of taking a step back from our path, we will continue along this road," he said as he was released.
The boy, who was arrested by police at school, during questioning denied links with a political party but confirmed he had made the statements in question.
Altunses had accused Erdogan of being the "chief of theft, bribery and corruption".
Despite his release, he still remains accused of insulting Erdogan and faces trial at a date yet to be specified. He risks up to four years in prison if convicted.
The boy's lawyer, Baris Ispir, had submitted a petition for his release to the court, together with around 100 colleagues who came from Istanbul in a show of support.
The boy's mother, an unemployed cook, expressed shock over the arrest, saying he had been detained "as if he were an armed terrorist".
"He is only a boy, his place is in school and not the prison," Nazmiye Gok told the Hurriyet daily.
His arrest came amid growing concerns about freedom of speech in Turkey under Erdogan following raids earlier this month on opposition media linked to the president's top foe, exiled cleric Fethullah Gulen.
Sezgin Tanrikulu, vice president of the main opposition Republican People's Party (CHP), wrote on Twitter that the release would do nothing to change "the miserable situation in which our democracy finds itself".
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
