Frontotemporal dementia (FTD) is the second most common dementia before 65 years of age. Haploinsufficiency in the progranulin (GRN) gene accounts for 10% of all cases of familial FTD. GRN mutation carriers have an increased risk of autoimmune disorders, accompanied by elevated levels of tissue necrosis factor (TNF) α. We examined behavioral alterations related to obsessive-compulsive disorder (OCD) and the role of TNFα and related signaling pathways in FTD patients with GRN mutations and in mice lacking progranulin (PGRN). We found that patients and mice with GRN mutations displayed OCD and self-grooming (an OCD-like behavior in mice), respectively. Furthermore, medium spiny neurons in the nucleus accumbens, an area implicated in development of OCD, display hyperexcitability in PGRN knockout mice. Reducing levels of TNFα in PGRN knockout mice abolished excessive self-grooming and the associated hyperexcitability of medium spiny neurons of the nucleus accumbens. In the brain, PGRN is highly expressed in microglia, which are a major source of TNFα. We therefore deleted PGRN specifically in microglia and found that it was sufficient to induce excessive grooming. Importantly, excessive grooming in these mice was prevented by inactivating nuclear factor κB (NF-κB) in microglia/myeloid cells. Our findings suggest that PGRN deficiency leads to excessive NF-κB activation in microglia and elevated TNFα signaling, which in turn lead to hyperexcitability of medium spiny neurons and OCD-like behavior.