Er$_2$Sn$_2$O$_7$ remains a puzzling case among the extensively studied frustrated compounds of the rare-earth pyrochlore family. Indeed, while a first order transition towards a long-range antiferromagnetic state with the so-called Palmer-Chalker structure is theoretically predicted, it has not been observed yet, leaving the issue, as to whether it is a spin-liquid candidate, open. We report on neutron scattering and magnetization measurements which evidence a second order transition towards this Palmer-Chalker ordered state around 108 mK. Extreme care was taken to ensure a proper thermalization of the sample, which has proved to be crucial to successfully observe the magnetic Bragg peaks. At the transition, a gap opens in the excitations, superimposed on a strong quasielastic signal. The exchange parameters, refined from a spin wave analysis in applied magnetic field, confirm that Er$_2$Sn$_2$O$_7$ is a realization of the dipolar XY pyrochlore antiferromagnet. The proximity of competing phases and the strong XY anisotropy of the Er$^{3+}$ magnetic moment might be at the origin of enhanced fluctuations, leading to the unexpected nature of the transition, the low ordering temperature, and the observed multi-scale dynamics.