The inelastic hadronic cross section in proton–lead collisions at a centre-of-mass energy per nucleon pair of 5.02 TeV is measured with the CMS detector at the LHC. The data sample, corresponding to an integrated luminosity of L=12.6±0.4 nb−1 , has been collected with an unbiased trigger for inclusive particle production. The cross section is obtained from the measured number of proton–lead collisions with hadronic activity produced in the pseudorapidity ranges 3<η<5 and/or −5<η<−3 , corrected for photon-induced contributions, experimental acceptance, and other instrumental effects. The inelastic cross section is measured to be σinel(pPb)=2061±3(stat)±34(syst)±72(lumi) mb . Various Monte Carlo generators, commonly used in heavy ion and cosmic ray physics, are found to reproduce the data within uncertainties. The value of σinel(pPb) is compatible with that expected from the proton–proton cross section at 5.02 TeV scaled up within a simple Glauber approach to account for multiple scatterings in the lead nucleus, indicating that further net nuclear corrections are small.