The 21-year-old man from the northern city of Hildesheim made the threat in an anonymous online chat forum on May 29, announcing his intention to carry out an attack "with multiple dead," prosecutors in the city of Celle said in a statement.
He referenced the March 2019 Christchurch mosque attack in New Zealand where a gunman killed 51 people, saying that he wanted to carry out a similar attack in Germany.
"The goal was to kill Muslims," prosecutors said.
The man is believed to have been considering carrying out a mass-casualty attack for some time, also seeking to attract worldwide media attention.
During a raid on the man's apartment, police uncovered data files containing right-wing extremist content as well as weapons that "may have been purchased to carry out the attack plans."
Germany grapples with right-wing violence
The suspect was arrested on Saturday and faces a string of charges including threatening to commit criminal offences, disturbing the peace and financing terrorism through purchasing weapons.
Germany has seen several deadly right-wing extremist attacks over the past year, with Interior Minister Horst Seehofer at one point calling right-wing terrorism "the biggest danger for democracy in Germany."
In February, a gunman with far-right beliefs killed nine people in the city of Hanau in an attack targeting hookah bars.
Last October, a gunman killed two people in an attack targeting a synagogue in the eastern German city of Halle.
One year ago, pro-immigration CDU politician Walter Lübcke was shot dead at his come in the central state of Hesse; a neo-Nazi suspect has been charged with this murder.