Cardiopharyngeal mesoderm contributes to the formation of the heart and head muscles. However, the mechanisms governing cardiopharyngeal mesoderm specification remain unclear. Indeed, there is a lack of anin vitromodel replicating the differentiation of both heart and head muscles to study these mechanisms. Such models are required to allow live-imaging and high throughput genetic and drug screening. Here, we show that the formation of self-organizing or pseudo-embryos from mouse embryonic stem cells (mESCs), also called gastruloids, reproduces cardiopharyngeal mesoderm specification towards cardiac and skeletal muscle lineages. By conducting a comprehensive temporal analysis of cardiopharyngeal mesoderm establishment and differentiation in gastruloids and comparing it to mouse embryos, we present the first evidence for skeletal myogenesis in gastruloids. By inferring lineage trajectories from the gastruloids single-cell transcriptomic data, we further suggest that heart and head muscles formed in gastruloids derive from cardiopharyngeal mesoderm progenitors. We identify different subpopulations of cardiomyocytes and skeletal muscles, which most likely correspond to different states of myogenesis with “head-like” and “trunk-like” skeletal myoblasts. These findings unveil the potential of mESC-derived gastruloids to undergo specification into both cardiac and skeletal muscle lineages, allowing the investigation of the mechanisms of cardiopharyngeal mesoderm differentiation in development and how this could be affected in congenital diseases.