The first observation of the decay of a B0 meson to a purely baryonic final state, B0→pp, is reported. The proton-proton collision data sample used was collected with the LHCb experiment at center-of-mass energies of 7 and 8 TeV and corresponds to an integrated luminosity of 3.0 fb-1. The branching fraction is determined to be B(B0→pp)=(1.25±0.27±0.18)×10-8, where the first uncertainty is statistical and the second systematic. The decay mode B0→pp is the rarest decay of the B0 meson observed to date. The decay Bs0→pp is also investigated. No signal is seen and the upper limit B(Bs0→pp)<1.5×10-8 at 90% confidence level is set on the branching fraction.