During a lengthy meeting with German investigators on Thursday, Stephan B. spoke "very extensively" and admitted that anti-Semitic and right-wing extremist beliefs motivated him to commit the attack, a spokesperson for the Federal Prosecutor's Office said.
"He gave an extensive confession. He confirmed far-right and anti-Semitic motives" for the attack, the spokesman said.
The suspect made the confession to the judge at Germany's Federal Court of Justice on Thursday evening. The arrest warrant, issued on Thursday, was for two counts of murder and seven counts of attempted murder.
Prosecutors also said on Friday that Stephan B. had built his own weapons. After finding a 3D printer in his home, investigators said that they believed he had used this to assemble the weapons.
Stephan B. is currently in custody awaiting trial and the German authorities are treating the incident as a far-right terrorist attack.
German Defence Minister Annegret Kramp-Karrenbauer in comments published inthe Tagesspiegel newspaper on Friday said, "Our country and its basic order is being attacked from within." She also called for stronger security laws.
Meanwhile, German Interior Minister Horst Seehofer has accused right-wing party Alternative for Germany (AfD) of being partially responsible for the attack, and said they should distance themselves from inflammatory and hateful rhetoric.
He also described an "elevated" risk of attacks. He warned on Friday that more attacks could happen "at any moment" and that Berlin was "extremely alert" to further attacks.
Germany's upper house of parliament, the Bundesrat, on Friday held a minute of silence for the victims of the attack.
Eye-witness: "For some seconds, everyone was silent and confused"