A search is performed for heavy long-lived charged particles using 3.0 fb-1 of proton–proton collisions collected at √s= 7 and 8 TeV with the LHCb detector. The search is mainly based on the response of the ring imaging Cherenkov detectors to distinguish the heavy, slow-moving particles from muons. No evidence is found for the production of such long-lived states. The results are expressed as limits on the Drell–Yan production of pairs of long-lived particles, with both particles in the LHCb pseudorapidity acceptance, 1.8<η<4.9. The mass-dependent cross-section upper limits are in the range 2–4 fb (at 95 % CL) for masses between 14 and 309 GeV/c2.