Pain in early life may affect cortical development and risk of chronic pain. We developed an optogenetic Cre/loxP mouse model of "early-life-pain" (ELP) using mice with transgenic expression of channelrhodopsin-2 (ChR2) under control of the Advillin (Avil) promoter, that drives expression of ChR2 in peripheral somatosensory neurons. Avil-ChR2 (Cre+) and ChR2-flfl control mice were exposed to blue light in a chamber once daily from P1-P5 together with their Cre-negative mother. ELP caused cortical hyperexcitability at P8-9 as assessed via multi-electrode array recordings that coincided with reduced expression of synaptic genes (RNAseq) including Grin2b, neurexins, piccolo and voltage gated calcium and sodium channels which would agree with activity-dependent synaptic pruning. Young adult Avil-ChR2 mice presented with nociceptive hypersensitivity upon heat or mechanical stimulation, which did not resolve up until one year of age. The persistent "pain" phenotype was reflected by capsaicin hypersensitivity in primary sensory neurons of aged mice as assessed by calcium imaging. Avil-ChR2 mice had no disadvantages in Maze tests of anxiety, social interaction and spatial memory, and multiple dimensions of cognitive behavior in IntelliCages. But they stood out by a high rate of repetitive nosepokes, and repetitive corner returns irrespective of success, suggesting inflexibility. Hence, optogenetic early life pain leads to pain in adult mice and repetitive behavior but without cognitive or social deficits.