The 28-year-old man, originally from Libya, was arrested in Bernau, northeast of Berlin, on Saturday.
"There are indications that he planned an attack on the Israeli embassy in Berlin," says a spokesperson for the prosecutor's office.
According to the German newspaper Bild Zeitung, the man was arrested after tips from a foreign intelligence service. He was not on any list of Islamist militants.
He is believed to have come to Germany in November 2022, applied for asylum a few months later, but was rejected in September 2023.
A hearing is to be held in court on Sunday about the further proceedings, reports Der Spiegel.
The Israeli ambassador in Germany, Ron Prosor, thanks the German authorities for their actions for the embassy's security.
Both the Israeli embassy in Copenhagen and the one in Stockholm were recently targeted in attacks.