A spokeswoman for the Bavarian state police force said on Monday it was unclear whether the man was an Islamist militant, and that investigations were continuing.
German newspaper Die Welt quoted Bavarian Interior Minister Joachim Herrmann earlier as saying: "My personal view is that it is unfortunately very likely that a real Islamist suicide attack took place here."
The incident, on top of three other attacks since July 18 that left 10 people dead and 34 injured, will fuel growing public unease about Chancellor Angela Merkel's open-door refugee policy. More than a million migrants have entered Germany over the past year, many fleeing war in Afghanistan, Syria and Iraq.
Police said three of the 12 wounded were in a serious condition after the attack in Ansbach, a town of 40,000 people southwest of Nuremberg that has a U.S. Army base.
The dead man had been in treatment after twice before trying to kill himself, though Sunday evening's explosion was more than just "a pure suicide attempt", Herrmann told Reuters. An Islamist link could not be ruled out, he told reporters earlier.
"It's terrible ... that someone who came into our country to seek shelter has now committed such a heinous act and injured a large number of people who are at home here, some seriously," Herrmann told a news conference early on Monday.
"It's a further, horrific attack that will increase the already growing security concerns of our citizens. We must do everything possible to prevent the spread of such violence in our country by people who came here to ask for asylum."