About 2,000 years ago, the powerful ancient kingdom of the Nabataeans hand-carved a city into the sandstone cliffs of Petra .