Many extensions of the Standard Model predict the existence of charged heavy long-lived particles, such as R-hadrons or charginos. These particles, if produced at the Large Hadron Collider, should be moving non-relativistically and are therefore identifiable through the measurement of an anomalously large specific energy loss in the ATLAS pixel detector. Measuring heavy long-lived particles through their track parameters in the vicinity of the interaction vertex provides sensitivity to metastable particles with lifetimes from 0.6 ns to 30 ns. A search for such particles with the ATLAS detector at the Large Hadron Collider is presented, based on a data sample corresponding to an integrated luminosity of [Formula: see text] fb[Formula: see text] of pp collisions at [Formula: see text] TeV. No significant deviation from the Standard Model background expectation is observed, and lifetime-dependent upper limits on R-hadrons and chargino production are set. Gluino R-hadrons with 10 ns lifetime and masses up to 1185 GeV are excluded at 95 [Formula: see text] confidence level, and so are charginos with 15 ns lifetime and masses up to 482 GeV.