Aims/hypothesis To assist in the development of preventive strategies, we studied whether the neighbourhood environment or modifiable behavioural parameters, including cardiorespiratory fitness (CRF) and physical activity (PA), are independently associated with obesity and metabolic risk markers in children. Methods We carried out a cross-sectional analysis of 502 randomly selected first and fifth grade urban and rural Swiss schoolchildren with regard to CRF, PA and the neighbourhood (rural vs urban) environment. Outcome measures included BMI, sum of four skinfold thicknesses, homeostasis model assessment of insulin resistance (HOMA-IR) and a standardised clustered metabolic risk score. Results CRF and PA (especially total PA, but also the time spent engaged in light and in moderate and vigorous intensity PA) were inversely associated with measures of obesity, HOMA-IR and the metabolic risk score, independently of each other, and of sociodemographic and nutritional parameters, media use, sleep duration, BMI and the neighbourhood environment (all p<0.05). Children living in a rural environment were more physically active and had higher CRF values and reduced HOMA-IR and metabolic risk scores compared with children living in an urban environment (all p<0.05). These differences in cardiovascular risk factors persisted after adjustment for CRF, total PA and BMI. Conclusions/interpretation Reduced CRF, low PA and an urban environment are independently associated with an increase in metabolic risk markers in children.