The production of electrons from heavy-flavour hadron decays was measured as a function of transverse momentum (ac1af122e" title="Click to view the MathML source">pT) in minimum-bias p–Pb collisions at using the ALICE detector at the LHC. The measurement covers the ac1af122e" title="Click to view the MathML source">pT interval 0.5<pT<12 GeV/c and the rapidity range −1.065<ycms<0.135 in the centre-of-mass reference frame. The contribution of electrons from background sources was subtracted using an invariant mass approach. The nuclear modification factor RpPb was calculated by comparing the ac1af122e" title="Click to view the MathML source">pT-differential invariant cross section in p–Pb collisions to a pp reference at the same centre-of-mass energy, which was obtained by interpolating measurements at and . The RpPb is consistent with unity within uncertainties of about 25%, which become larger for ac1af122e" title="Click to view the MathML source">pT below ac3ba3974d40eee946a81b9971c005df" title="Click to view the MathML source">1 GeV/c. The measurement shows that heavy-flavour production is consistent with binary scaling, so that a suppression in the high-ac1af122e" title="Click to view the MathML source">pT yield in Pb–Pb collisions has to be attributed to effects induced by the hot medium produced in the final state. The data in p–Pb collisions are described by recent model calculations that include cold nuclear matter effects.