New metastable massive particles with electric and colour charge are features of many theories beyond the Standard Model. A search is performed for long-lived gluino-based R-hadrons with the ATLAS detector at the LHC using a data sample corresponding to an integrated luminosity of 31 pb−1. We search for evidence of particles that have come to rest in the ATLAS detector and decay at some later time during the periods in the LHC bunch structure without proton–proton collisions. No significant deviations from the expected backgrounds are observed, and a cross-section limit is set. It can be interpreted as excluding gluino-based R-hadrons with masses less than 341 GeV at the 95 % C.L., for lifetimes from 10−5to 103seconds and a neutralino mass of 100 GeV.