Understanding the roots of human cooperation among strangers is of great importance for solving pressing social dilemmas and maintening public goods in human societies. We study the development of cooperation in 929 young children, aged 3 to 6. In a unified experimental framework, we examine which of three fundamental pillars of human cooperation - direct and indirect reciprocity as well as third-party punishment - emerges earliest as an effective means to increase cooperation in a repeated prisoner's dilemma game. We find that third-party punishment exhibits a strikingly positive effect on cooperation rates by doubling them in comparison to a control condition. It promotes cooperative behavior even before punishment of defectors is applied. Children also engage in reciprocating others, showing that reciprocity strategies are already prevalent at a very young age. However, direct and indirect reciprocity treatments do not increase overall cooperation rates, as young children fail to anticipate the benefits of reputation building. We also show that the cognitive skills of children and the socioeconomic background of parents play a vital role in the early development of human cooperation.