The man had previously threatened to murder the social secretary and later attacked her inside the social services office in Mellerud.
He is now sentenced to forensic psychiatric care with special release assessment, local media reports.
The incident occurred at the end of October last year. The social secretary sustained minor injuries in the attack.