Hypothalamic pituitary adrenal (HPA) axis activity may be a mechanism linking early adversity to child mental health difficulties. However, there is a dearth of longitudinal evidence for the association between HPA axis activity and mental health among children in low-resource contexts. The goal of this study is to examine linear and curvilinear associations between HPA axis activity during infancy and mental health difficulties in early childhood among children in rural Pakistan. Participants included 104 children (46% male) from the Bachpan study, a longitudinal cohort embedded within a maternal depression trial in Pakistan. We examined the associations between hair-derived cortisol and dehydroepiandosterone (DHEA) at 12 months old and mental health difficulties, measured with the Strengths and Difficulties Questionnaire (SDQ), at 36 months old. There was a significant quadratic association between hair cortisol and SDQ scores, with results showing a U-shaped relationship (i.e., having relatively high or low cortisol predicted increased mental health difficulties). DHEA showed a quadratic association with SDQ scores with an inverted U-shaped relationship (i.e., high and low DHEA was associated with decreased mental health difficulties). Results provide evidence of longitudinal and curvilinear effects of cortisol and DHEA during infancy on mental health difficulties in early childhood.