Neurotrypsin (NT) is a neuronal trypsin-like serine protease whose mutations cause severe mental retardation in humans. NT is activated by Hebbian-like conjunction of pre- and postsynaptic activities, which promotes the formation of dendritic filopodia via proteolytic cleavage of the proteoglycan agrin. Here, we investigated the functional importance of this mechanism for synaptic plasticity, learning and extinction of memory. We report that juvenile neurotrypsin-deficient (NT-/-) mice exhibit impaired long-term potentiation induced by a spaced stimulation protocol designed to probe the generation of new filopodia and their conversion into functional synapses. Behaviorally, juvenile NT-/- mice show impaired contextual fear memory and have a sociability deficit. The latter persists in aged NT-/- mice, which, unlike juvenile mice, show normal recall but impaired extinction of contextual fear memories. Structurally, juvenile mutants exhibit significantly reduced spine density in the CA1 region, fewer thin spines and no modulation in the number and spatial distribution of dendritic spines following fear conditioning and extinction in contrast to wild-type littermates. Spine loss in NT-/- mice is abrogated by in vivo delivery of adeno-associated virus expressing an NT-generated fragment of agrin, agrin-22, but not by a shorter fragment, agrin-15. Moreover, agrin-22 co-aggregates with pre- and postsynaptic terminals immunopositive for vesicular glutamate transporter 1 and postsynaptic density protein PSD95 and dramatically increases the size of synaptic puncta, suggesting that agrin-22 supports the growth and/or clustering of excitatory synapses in vivo.