The total cross section for the $pp to pp pi^0$ reaction at energies close to threshold is calculated within the frame of a chiral perturbation theory, taking into account tree and one loop diagrams up to chiral order D=2. Two-pion loop contributions dominate $pi^0$ production at threshold. The calculated cross section reproduces data, both scale and energy dependence, fairly well.