OCD is classified as an anxiety disorder. The repetitive behaviors that people with OCD perform are done in part to try and prevent feeling anxious, and trying to not perform them also creates anxiety.