The emergence of multiple axes is an essential element in the establishment of the mammalian body plan. This process takes place shortly after implantation of the embryo within the uterus and relies on the activity of gene regulatory networks that coordinate transcription in space and time. Whereas genetic approaches have revealed important aspects of these processes1, a mechanistic understanding is hampered by the poor experimental accessibility of early post-implantation stages. Here we show that small aggregates of mouse embryonic stem cells (ESCs), when stimulated to undergo gastrulation-like events and elongation in vitro, can organize a post-occipital pattern of neural, mesodermal and endodermal derivatives that mimic embryonic spatial and temporal gene expression. The establishment of the three major body axes in these 'gastruloids'2,3 suggests that the mechanisms involved are interdependent. Specifically, gastruloids display the hallmarks of axial gene regulatory systems as exemplified by the implementation of collinear Hox transcriptional patterns along an extending antero-posterior axis. These results reveal an unanticipated self-organizing capacity of aggregated ESCs and suggest that gastruloids could be used as a complementary system to study early developmental events in the mammalian embryo.