Previous studies showed that functional connectivity (FC) within resting state (RS) networks is modulated by previous experience. In this study the effects of sustained cognitive performance on subsequent RS FC were investigated in healthy young (25-30 years; n=15) and middle-aged (50-60 years; n=14) male schoolteachers. Participants were scanned (functional magnetic resonance imaging [MRI]) after a cognitively demanding and a control intervention (randomized tester-blind within-subject design). Independent component analysis (ICA) was used to decompose the data into spatially independent networks. This study focused on the executive control (ExN), the left and right frontoparietal (FPN), and the default mode network (DMN). The effects of cognitive performance and age were calculated with a full-factorial analysis of variance (ANOVA). A main effect of age was found in the left inferior frontal gyrus for the ExN and in the middle frontal gyrus for the DMN with middle-aged teachers having reduced RS FC. Sustained cognitive performance increased subsequent RS FC between the ExN and a lingual/parahippocampal cluster, and between the left FPN and a right calcarine/precuneus cluster. In these clusters, FC strength correlated positively with the perceived amount of effort during the intervention. Further, sustained cognitive performance affected subsequent RS FC between the ExN and the right temporal superior gyrus differently in young and middle-aged men. The results suggest that effects of age on RS FC are already present at middle age. Sustained cognitive performance increased RS FC between task-positive networks and other brain regions, although a change in RS FC within the networks was not found.