0951 GMT February 29, 2020
Styling himself "G0d", he published private information about politicians, journalists and celebrities on Twitter, under the username @_0rbit, BBC reported.
Investigators said the man was still in education and living with his parents.
The suspect said he acted alone and out of annoyance at statements made by the public figures he attacked.
Some 1,000 people were affected including German Chancellor Angela Merkel.
Politicians from every major political party except for the far-right AfD were targeted, although investigators said they had yet to find evidence of the suspect's political inclinations.
Germany's Federal Criminal Police Office (BKA) said the information published online included telephone numbers, addresses, credit card data, photographs and private communications.
Investigators said the German citizen they arrested had cooperated and led them to evidence they may not have found without help. Police are also still investigating seized computer hardware.
In a statement, the BKA said he was detained after a search of his home in the state of Hesse on Sunday. He is accused of spying and the unauthorized publication of data.
His provisional arrest, however, was lifted on Monday evening. He was released "due to a lack of grounds for detention,” police said.
They took into account both his age and his cooperation.
The @_0rbit Twitter account has been suspended since coming to widespread attention late last week. Before then, it published the leaked information in an "advent calendar event" each day in December.
Its biography had described itself as involved in "security research".