Zurich cantonal police said in a statement that they had arrested the suspect in Thalwil, a town about 60 kilometres from Schaffhausen where the incident took place.
The suspect was named earlier as Franz Wrousis, a drifter with a criminal record who mostly lived in the woods. Swiss health insurer CSS, whose office in Schaffhausen Wrousis had stormed, has said he was a client there.