Viviparity in Mesozoic marine reptiles has traditionally been considered an aquatic adaptation. We report a new fossil specimen that strongly contradicts this traditional interpretation. The new specimen contains the oldest fossil embryos of Mesozoic marine reptile that are about 10 million years older than previous such records. The fossil belongs to Chaohusaurus (Reptilia, Ichthyopterygia), which is the oldest of Mesozoic marine reptiles (ca. 248 million years ago, Early Triassic). This exceptional specimen captures an articulated embryo in birth position, with its skull just emerged from the maternal pelvis. Its headfirst birth posture, which is unlikely to be a breech condition, strongly indicates a terrestrial origin of viviparity, in contrast to the traditional view. The tail-first birth posture in derived ichthyopterygians, convergent with the conditions in whales and sea cows, therefore is a secondary feature. The unequivocally marine origin of viviparity is so far not known among amniotes, a subset of vertebrate animals comprising mammals and reptiles, including birds. Therefore, obligate marine amniotes appear to have evolved almost exclusively from viviparous land ancestors. Viviparous land reptiles most likely appeared much earlier than currently thought, at least as early as the recovery phase from the end-Permian mass extinction.