ECT is sometimes used as a last option to treat other conditions. When a person with obsessive-compulsive disorder does not respond to medications or other treatments, ECT may be used.