A 20-year-old man has been arrested on suspicion of being responsible for a major hacking attack in which the private data of hundreds of German politicians and celebrities was released on the internet, police said on Tuesday.

The man, who has not been named under German privacy laws, has confessed to being behind what is thought to be the biggest data hack in German history.

Police said he had acted out of “anger” at the politicians and celebrities involved. He is believed to have acted alone and there is no suspicion of foreign intelligence involvement.

The suspect is a German citizen. According to local press reports, he is student who lives with his parents, described by acquaintances as a “loner”.

Angela Merkel and the German president, Frank-Walter Steinmeier, are among those affected by the hacking attack, in which the private data of around 1,000 MPs, journalists and celebrities was released on Twitter.

Initial suspicions pointed towards a foreign power such as Russia, which has been accused of being behind previous hacking attacks on Germany, but police say in this case they believe the arrested man acted alone.

“Investigations have so far revealed no evidence of third party participation. As to his motivation, the defendant stated that he acted out of anger at the public statements of the politicians, journalists and public figures concerned,” police said in a statement.