Stephan Balliet, 27, made a “very comprehensive” confession during an interrogation lasting several hours, said a spokesman for the federal prosecutor's office in Karlsruhe.
“He gave an extensive confession. He confirmed far-right and anti-Semitic motives” for the attack, the spokesman said.
Balliet is accused of shooting dead two people in the eastern German city of Halle on Wednesday, after he tried and failed to storm a synagogue.
The man, who was described by neighbours and his father as a loner who spent much of his time at a computer, had filmed and live-streamed the assault.
The victims, a German man and woman, appeared to be chosen at random when the assailant failed to gain access to the synagogue he had besieged with gunfire and homemade explosives, as the frightened congregation barricaded itself inside.
Police eventually captured Balliet after a gun battle that left him wounded.
Balliet's lawyer Hans-Dieter Weber told public broadcaster Südwestrundfunk that his client stood by his actions.
“It would be nonsensical to deny it, and he didn't do that,” said Weber.
“In his view of the world, he blames others for his own misery and that's what ultimately triggered his action.”
Balliet's confession came as Jews prepared to mark the Sabbath from sundown, with solidarity action also planned across the country, including at the synagogue targeted in Halle.
Hours ahead of the Sabbath, Max Privorozki, who heads the Jewish community in Halle, said Jews would not allow themselves to be intimidated by the assault.
Around 50 people were in the synagogue to mark the holy Jewish day of Yom Kippur, when the assailant had tried to shoot his way into the Jewish temple.
Armed with weapons he is believed to have built himself and along with four kilos of explosives in his car, Balliet began his rampage at noon.
Throughout a video the shooter made of his actions using a helmet-mounted smartphone, his rage bubbles to the surface, when he calls himself a “fucking idiot”, a “failure” and a “loser”.
Investigators searching Balliet's father's apartment found a 3-D printer, which could have been used to manufacture firearms, according to Spiegel magazine.
Police have also confiscated a hard-drive from his bedroom in the apartment he shared with his divorced mother.
Federal prosecutor Peter Frank called the act “terror” and said it had been planned to be a “massacre”.
Noting that it was only thanks to the Halle synagogue's own security measures that the assailant had been kept from penetrating the temple, Jewish leaders have demanded authorities to do more to protect the community.
On Thursday, Chancellor Angela Merkel vowed that there would be “zero tolerance” for hate, while Interior Minister Horst Seehofer said protection will be stepped up immediately for all Jewish sites and institutions in Germany.
Germany has taken pride in the rebirth of Jewish life since the Nazis' World War II slaughter of six million Jews across Europe.
The community has grown to about 225,000 thanks in large part to an influx from the ex-Soviet Union after the fall of the Berlin Wall.