A Syrian refugee blew himself up and injured 12 innocent bystanders in Germany Sunday night when he detonated a bomb near a bar after being turned away from a packed music festival.

The blast — which was the European nation’s fourth violent incident in a week, including a machete murder earlier Sunday by another Syrian refugee — occurred outside Eugene’s Wine Bar just after 10 p.m. in the southern city of Ansbach.

“We don’t know if this man planned on suicide or if he had the intention of killing others,” Bavarian Interior Minister Joachim said.

The bomber was a 27-year-old Syrian who was denied asylum a year ago but who was allowed to remain in Germany due to the dire situation in Syria. He had been treated after suicide attempts in the past, officials said.

“It is terrible that someone abuses the opportunity to find protection here in such a way. I am appalled by that,” Herrmann said. “We have to do all we can so that such violence in our country committed by asylum-seekers who have come to our country will not spread any further.”

Officials said the man had been targeting an open-air music festival — where some 2,500 concertgoers were in attendance — but he was not allowed in by security.

He then proceeded to the nearby bar, where he detonated an improvised explosive device concealed in a backpack.

Herrmann said that the contents of the bomb included metal items typically used in “wood manufacturing” and that they had the power to kill more people than were injured.

The bomber was killed instantly. Those who were hurt were expected to survive.

Just hours before the blast, at 4:30 p.m., a 21-year-old Syrian refugee hacked a pregnant kebab-stand worker to death with a machete and injured two others in

Reutlingen, near Stuttgart. The man had been arguing with the woman at the stand near a bus station, and locals indicated that it may have been a crime of passion.

Germany had already been on edge following a series of vicious assaults on civilians across the country in recent days.

On July 18, an ax-wielding refugee from Pakistan struck on a train in the south German town of Würzburg, injuring five people before he was shot dead by police.

And on Friday, nine people were killed in a shooting rampage near a shopping mall in Munich, which was carried out by an 18-year-old, German-born Iranian teenager who later took his own life.

Authorities said on Sunday that the Munich murderer, Ali David Sonboly, was a loner who was obsessed with playing “killer” video games.

Officials said the young man had been planning the assault for at least a year, and had experienced panic attacks when coming in contact with other people.

While there was no immediate word on possible motives for the explosion on Sunday night, police said neither the machete attack earlier in the day nor Friday’s shooting in Munich appeared to be tied to ISIS or other terror groups.