We construct a functor associating a cubical set to a (simple) graph. We show that cubical sets arising in this way are Kan complexes, and that the A-groups of a graph coincide with the homotopy groups of the associated Kan complex. We use this to prove a conjecture of Babson, Barcelo, de Longueville, and Laubenbacher from 2006, and a strong version of the Hurewicz theorem in discrete homotopy theory.