Decays of B0 and Bs0 mesons to the charmless baryonic final states pph+h′−, where h and h′ each denote a kaon or a pion, are searched for using the LHCb detector. The analysis is based on a sample of proton-proton collision data collected at center-of-mass energies of 7 and 8TeV, corresponding to an integrated luminosity of 3fb−1. Four-body charmless baryonic Bs0 decays are observed for the first time. The decays Bs0→ppK+K−, Bs0→ppK±π∓, B0→ppK±π∓ and B0→ppπ+π− are observed with a significance greater than 5 standard deviations; evidence at 4.1 standard deviations is found for the B0→ppK+K− decay and an upper limit is set on the branching fraction for Bs0→ppπ+π−. Branching fractions in the kinematic region m(pp)<2850MeV/c2 are measured relative to the B0→J/ψ(→pp)K∗(892)0 channel.