General cognitive ability (‘general intelligence’) has been shown to buffer the effects of family adversity and poverty on emotional and behavioural problems in school age children. Yet, little is known about whether it can protect younger children or change the problem trajectories of at-risk children. We modelled simultaneously the effects of family poverty, neighbourhood poverty and adverse family events on children’s trajectories of emotional and behavioural problems at ages 3, 5 and 7. We then tested the role of general intelligence both in changing the trajectories of problems and in buffering the effects of these risk factors at each age, and explored gender differences in its expected protective effects. We analyzed data on 16,916 children from the UK Millennium Cohort Study. General intelligence was derived from principal components analysis of several cognitive ability measures at ages 3, 5 and 7. Although general intelligence was not associated with the growth of at-risk children’s problems over time, it was associated with the level of positive emotional and behavioural outcomes, and conferred concurrent protection from risk. At age 5, poor children with higher general intelligence had fewer emotional problems than similarly poor children with lower intelligence. Children exposed to family adversity were less likely to have emotional problems at any age if they had higher general intelligence. Higher general intelligence was also related to fewer behavioural problems for children experiencing family adversity at age 5, but not at ages 3 or 7. General intelligence moderated the effect of neighbourhood poverty on behavioural problems at ages 3 and 7, and its effect on emotional problems at age 5. In general, the protective effects of general intelligence, especially for emotional outcomes, applied mainly to girls. General intelligence appears to assist children in building resilience to both family and neighbourhood risk across childhood.