BERLIN — German officials have faced accusations for years of turning a blind eye to the threat posed by right-wing extremists. But after a German who embraced violent racist ideals killed nine mostly young people in hookah bars in the central city of Hanau this week, the response was swift and clear.

“Far-right terror is the biggest threat to our democracy right now,” Christine Lambrecht, the justice minister, told reporters on Friday, a day after joining the country’s president at a vigil for the victims. “This is visible in the number and intensity of attacks.”

The Hanau shootings on Wednesday were the latest in a series of far-right attacks at a time when the country’s hard-won democratic institutions face growing distrust and its usually consensus-driven politics have been fractured by the rise of a right-wing populist party, Alternative for Germany.