Many species of animals exhibit caregiving or aggression toward conspecific offspring. The neural mechanisms underlying the infanticide and pup care remain poorly understood. Here, using monogamous mandarin voles (Microtus mandarinus), we found that more oxytocin (OT) neurons in the paraventricular nucleus (PVN) were activated during pup caring than infanticide. Optogenetic activation of OT neurons in the PVN facilitated pup caring in male and female mandarin voles. In infanticide voles, optogenetic activation of PVN OT cells or PVN-medial prefrontal cortex (mPFC) OT projection fibers prolonged latency to approach and attack pups, whereas inhibition of these OT neurons or projections facilitated approach and infanticide. Optogenetic activation of PVN OT neuron projections to the mPFC in males shortened the latency to approach and retrieve pups and facilitated the initiation of pup care, but produced no effects on pup-care females. In addition, OT release in the mPFC increased upon approaching and retrieving pups, and decreased upon attacking pups. Intraperitoneal injection of OT promoted pup care and inhibited infanticide behavior. It is suggested that the OT system, especially PVN OT neurons projecting to mPFC, modulates pup-directed behaviors and OT can be used to treat abnormal behavioral responses associated with some psychological diseases such as depression and psychosis.