Justice Minister Heiko Maas said he had lost confidence in the chief prosecutor, Harald Range, who had hours earlier accused him of interfering in the judicial process.
The unusual public clash centres on a treason probe Range launched against the blog Netzpolitik.org for publishing classified plans by Germany's domestic security agency to expand its Internet surveillance.
News of the probe against Netzpolitik.org, which calls itself a digital civil rights blog, last Thursday set off a storm of protest and vows of solidarity from journalists, bloggers and politicians, who charged it was an attempt to silence investigative reporters.
Netzpolitik journalist Andre Meister, one of the journalists who had been under investigation, told The Local last week that the investigation was "absurd" and a "heavy blow" for press freedom in Germany.
"This is an attempt to curtail the media publishing damaging material, but it is also an attempt to put pressure on sources to stop leaking in the future," he said.
On Twitter #Landesverrat (#treason) became a top trending topic, while street protests and online petitions condemned Germany's first such investigation against the media in over half a century.
Minister Maas, with the support of Chancellor Angela Merkel, quickly distanced himself from the investigation, voicing doubt that the published documents indeed amounted to "state secrets".
Range fired back on Tuesday, openly accusing Maas of "an intolerable encroachment on the independence of the judiciary".
Hours later Maas responded, calling a press conference in which he rejected Range's accusations and dismissed his statements as "incomprehensible and misleading" for the public.
Maas said he had told the 67-year-old chief prosecutor that he had "lost confidence" in him and, with Merkel's support, would ask President Joachim Gauck to send him into early retirement.
The controversy has flared amid persistent anger in Germany over the US National Security Agency's mass surveillance activities revealed by fugitive intelligence contractor Edward Snowden, and questions about the extent of German cooperation.
Netzpolitik founder Markus Beckedahl said Tuesday he saw the treason probe as an "attempt to intimidate" journalists and their sources to stop reporting on aspects of "the greatest surveillance scandal in the history of humanity".
It was Range who earlier launched an investigation into alleged NSA eavesdropping on Merkel's mobile phone, then dropped the case citing a lack of evidence. Critics of the latest probe, against Netzpolitik, have accused his office of double standards.
Range on Tuesday defended his investigation, saying that an independent expert had agreed that the papers published by Netzpolitik appeared to be state secrets, as asserted by domestic security agency chief Hans-Georg Maassen.
The chief prosecutor said he had informed the justice minister of this but was told "to immediately stop" the process of commissioning outside advice.
Range said he had complied, but added angrily that "to exert influence on an investigation because its possible outcome may not be politically opportune represents an intolerable encroachment on the independence of the judiciary".
On the broader Netzpolitik case, Range said: "The freedom of the press and of expression is a valuable asset. But this freedom, including on the Internet, is not limitless. It does not absolve journalists of the duty to comply with the law."
The case also made waves abroad. The Organisation for Security and Cooperation in Europe on Tuesday urged that the probe be stopped, in an open letter to Foreign Minister Frank-Walter Steinmeier.
"The threat of being charged with treason has a clear general chilling effect on journalists engaged in investigative reporting," wrote OSCE media freedom representative Dunja Mijatovic.
"I urge the authorities in Germany to look into the case and ensure that freedom of information and freedom of the media are respected, and hope the investigation is terminated."