A German YouTube star’s hour-long video attacking the government has gone viral after being viewed 3.5 million times in just a few days.

Rezo, a 26-year-old music producer, posted the expletive-laden rant complete with footnotes to his 687,000 followers on Saturday.

In the 55-minute video, the YouTuber, who is known for his trademark blue hair, criticised the centre-right Christian Democratic Union's (CDU) stance on climate change and social inequality.

The video, which also takes aim at the centre-left Social Democrats and the far-right Alternative for Germany, comes as parties campaign ahead of the European Parliament elections on Sunday.

The general-secretary of German Chancellor Angela Merkel’s party, Paul Ziemiak, hit back at the video on Wednesday.

In an interview with Germany’s RND media group, he accused Rezo of “populism, insults and inaccurate simplification”.