Quantitative understanding of farmers' behaviour in pesticide use is critical to enhance sustainability of chemical pest control and protect farmers' health and the environment. However, reports on the levels of knowledge and awareness of farmers and the practices of pesticide use are often insufficient. Here, we conducted a comprehensive analysis on the effects of knowledge and awareness of farmers as well as the influence of the associated stakeholders (i.e. pesticide retailers and the government) on farmers' behaviour in pesticide use by using a detailed survey of 307 agricultural households (79 grain farms, 65 fruit farms, 53 vegetable farms and 110 mixed-crop farms) in the Wei River basin in northern China. Eight protective behaviours (PBs) were exhibited by farmers. Careful and safe storage of pesticides, changing clothes or showering after applying pesticides, and reading instructions of the container labels before application were the most frequent PBs. Vegetable and fruit farmers had higher levels of education and knowledge than grain farmers, but the former were less willing to reduce pesticide use because of fear of low profits and lack of trust in the government and pesticide retailers. The PBs of farmers were strongly affected by the perception of the consequences of their behaviour (standardised path coefficient, SPC=0.42) and the level of farmers' knowledge (SPC=0.33). Pesticide retailers and the government had a moderate and weak influence, respectively, on farmers' PBs, suggesting a large gap of trust among farmers, pesticide retailers, and the government. Training and supervising retailers, educating farmers, and improving information transparency across farmers, pesticide retailers and the staff of the Agricultural Extension and Technology Service are recommended for bridging the gap of trust between farmers and the associated stakeholders as well as for promoting the use of PBs among farmers.