Rho-associated kinases (ROCKs) are serine-threonine protein kinases that act downstream of small Rho GTPases to regulate the dynamics of the actin cytoskeleton. Two ROCK isoforms (ROCK1 and ROCK2) are expressed in the mammalian central nervous system. Although ROCK activity has been implicated in synapse formation, whether the distinct ROCK isoforms have different roles in synapse formation and function in vivo is not clear. Here, we used a genetic approach to address this long-standing question. Both Rock1+/- and Rock2+/- mice had impaired glutamatergic transmission, reduced spine density, and fewer excitatory synapses in hippocampal CA1 pyramidal neurons. In addition, both Rock1+/- and Rock2+/- mice showed deficits in long-term potentiation at hippocampal CA1 synapses and were impaired in spatial learning and memory based on the water maze and contextual fear conditioning tests. However, the spine morphology of CA1 pyramidal neurons was altered only in Rock2+/- but not Rock1+/- mice. In this study we compared the roles of ROCK1 and ROCK2 in synapse formation and function in vivo for the first time. Our results provide a better understanding of the functions of distinct ROCK isoforms in synapse formation and function.