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) alpha. We examined behavioral alterations related to obsessive-compulsive disorder (OCD) and the role of TNF alpha 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 alpha 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 alpha. 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-kappa B) in microglia/myeloid cells. Our findings suggest that PGRN deficiency leads to excessive NF-kappa B activation in microglia and elevated TNF alpha signaling, which in turn lead to hyperexcitability of medium spiny neurons and OCD-like behavior.