An age-associated decrease in N-methyl-D-aspartate receptor (NMDAR)-mediated synaptic function contributes to impaired synaptic plasticity and is associated with cognitive impairments. Levels of serine racemase (SR), an enzyme that synthesizes D-serine, an NMDAR co-agonist, decline with age. Thus, enhancing NMDAR function via increased SR expression in middle age, when subtle declines in cognition emerge, was predicted to enhance performance on a prefrontal cortex-mediated task sensitive to aging. Middle-aged (~12 mo) male Fischer-344 rats were injected bilaterally in the medial prefrontal cortex (mPFC) with viral vector (LV), SR (LV-SR) or control (LV-GFP). Rats were trained on the operant attentional set-shift task (AST) to examine cognitive flexibility and attentional function. LV-SR rats exhibited a faster rate of learning compared to controls during visual discrimination of the AST. Extradimensional set shifting and reversal were not impacted. Immunohistochemical analyses demonstrated that LV-SR significantly increased SR expression in the mPFC. Electrophysiological characterization of synaptic transmission in the mPFC slices obtained from LV-GFP and LV-SR animals indicated a significant increase in isolated NMDAR-mediated synaptic responses in LV-SR slices. Thus, results of the current study demonstrated that prefrontal SR upregulation in middle age rats can improve learning of task contingencies for visual discrimination and increase glutamatergic synaptic transmission, including NMDAR activity.