The unnamed suspect, who also injured himself, was arrested shortly after the attack in Saarbruecken, near the French border, and was then hospitalised, police said.
The victim was a psychologist who worked with traumatised refugees, said the German Red Cross, whose president Rudolf Seiters said he was "appalled and shocked" by the crime.
Germany has taken in more than one million asylum seekers since 2015, about half of them from war-torn Syria, Iraq and Afghanistan.