Parkinson's disease is characterized by the progressive loss of midbrain dopamine neurons. Dopamine replacement therapy with levodopa alleviates parkinsonian motor symptoms but is complicated by the development of involuntary movements, termed levodopa-induced dyskinesia (LID). Aberrant activity in the striatum has been hypothesized to cause LID. Here, to establish a direct link between striatal activity and dyskinesia, we combine optogenetics and a method to manipulate dyskinesia-associated neurons, targeted recombination in active populations (TRAP). We find that TRAPed cells are a stable subset of sensorimotor striatal neurons, predominantly from the direct pathway, and that reactivation of TRAPed striatal neurons causes dyskinesia in the absence of levodopa. Inhibition of TRAPed cells, but not a nonspecific subset of direct pathway neurons, ameliorates LID. These results establish that a distinct subset of striatal neurons is causally involved in LID and indicate that successful therapeutic strategies for treating LID may require targeting functionally selective neuronal subtypes.