A 3D graphitic foam vertically aligned graphitic structure and a low density of defects is derived through chloroaluminate anion intercalation of graphite followed by thermal expansion and electrochemical hydrogen evolution. Such aligned graphitic structure affords excellent Al-ion battery characteristics with a discharge capacity of ≈60 mA h g−1 under a high charge and discharge current density of 12 000 mA g−1 over ≈4000 cycles.