BERLIN—Authorities said a 27-year-old Syrian man tried to enter an outdoor concert in southern Germany and then blew himself up, injuring 12 people, in what appeared to be this country’s first suicide bombing in years.

The bombing took place in central Ansbach, a small town in the state of Bavaria that was hosting a concert that attracted 2,000 people on Sunday night.

Just...