A German student who lives with his parents, and received no formal computer training, admitted to hacking and releasing the personal details of hundreds of public figures like Chancellor Angela Merkel.

The 20-year-old stole photos, phone numbers, and credit card data from nearly 1,000 politicians and journalists, and published the information on Twitter last month.

Police arrested him on Sunday, but has since released him. He is now cooperating with investigators, the force said.

The student said he targeted people who made comments which had irritated him, police said.

A 20-year-old German student who lives with his parents, and who police say is not a computer expert, confessed to orchestrating a data hack that exposed personal details of Chancellor Angela Merkel and hundreds of Germany's elite.

The unnamed man released the personal details — including photos, phone numbers, correspondence, and credit card data — of nearly 1,000 politicians and journalists on the now suspended @_0rbit Twitter account last month, Germany's federal police, the Bundeskriminalamt (BKA) said on Tuesday.

"Police did not name the 20-year-old but said he lives with his parents and is not a computer expert," Reuters reported.

The student tweeted links and passwords to those accounts from December 1, which was illustrated as an Advent calendar in the countdown to Christmas.

A screenshot from the @_0rbit Twitter page where the data was leaked. The tweets show the name and title of a public figure and link to their personal details. Twitter/0rbit

The hacker published two of Merkel's email addresses and a tax code she previously used, CNBC reported. It's not clear if these were her personal or public accounts.

Other people who were affected included German news broadcasters, comedians, and rappers, the BBC said.

The student admitted to acting alone during the huge data collection, and said he targeted the victims because they had made comments that annoyed him, German prosecutors said.

Senior prosecutor Georg Ungefuk said, according to Reuters: "The accused said his motivation had been irritation over public statements made by the politicians, journalists and public figures affected."

The student was arrested on Sunday at a house in Hesse, central Germany, on suspicion of spying and illegally publishing personal information.

He has since been released and is cooperating with investigators, Ungefuk said.

The 20-year-old has also helped authorities "on other matters of interest regarding cyber crime," Ungefuk said.

Two of German Chancellor Angela Merkel's email addresses were published in the hack. Michele Tantussi/Getty

News outlets including The New York Times and Forbes previously suggested that the country's far-right Alternative for Germany (AfD) party would be blamed for the hack, as none of the party's members had their personal details exposed.

Germany's Social Democratic Party, whose members were hacked, also suggested that other countries could have been involved in the hack.

But the BKA said: "The investigations have so far provided no indication of the participation of a third party."

Police gave no indication about any future criminal charges.