Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A 27-year-old Syrian man who'd been denied asylum blew himself up Sunday night outside a music festival in the German city of Ansbach, killing himself and injuring at least 12 other people, authorities said.

The three-day open-air festival was taking place in Ansbach, a city of 40,000 people about 20 miles southwest of Nuremberg in Bavaria. The blast occurred just two days after a gunman killed nine people at a mall in Munich.

Armed officers stand guard in the blue glow of police lights after a deadly explosion Sunday night in Ansbach, Germany.

Joachim Herrmann, the interior minister in Bavaria, said at a news conference Monday morning that three of the wounded were in serious condition but that none of the injuries was believed to be life-threatening.

Herrmann said it remained to be determined whether the explosion was related to terrorism, but because the man wore a backpack carrying explosives and metal projectiles capable of hurting many people, "we must assume that it was not purely a suicide."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Michael Konrad, a Nuremberg police spokesman, also told NBC News that the explosion was an intentional act. Police said they weren't seeking any other suspects.

Middle Franconian regional police said the blast was reported about 10 p.m. (4 p.m. ET). The man had tried to enter the music festival, but he was turned away because he didn't have a ticket, the Nürnberger Zeitung newspaper reported.

Nürnberger Zeitung reported that about 2,500 people made an orderly evacuation. The rest of the event was canceled, it said.

Emergency vehicles race to the scene of an explosion Sunday night in the German city of Ansbach.

Thomas Trzybinski, 32, a supervisor for a company that provides security for U.S. Army installations in Ansbach, told NBC News on Monday morning that he was walking near the festival when the explosion went off.

"It was like boom, boom, boom, boom, and it was so loud it was like, 'Oh, my God, what was that?'" Trzybinksi said.

"Not even a few seconds later, people were running my way, and the first thing I heard was [that] a backpack blew up," he said. "I didn't know what to do at the first time, so I just followed them, you know, because I had no clue what's going on."

Herrmann, the interior minster, said the bomber was previously known to officials, having been rejected for asylum. The man had been under psychiatric treatment after at least two suicide attempts, Herrmann said.

Earlier Sunday, another Syrian man seeking asylum used a machete to kill a woman after an argument at the central Omnibus station in Reutlingen, about 22 miles south of Stuttgart, local police said.

The 21-year-old attacker injured another woman and a man before he was arrested a few minutes later close to the crime scene.

Reutlingen is 130 miles west of Munich, where nine people were killed by an 18-year-old gunman in a city shopping center Friday.