Abstract. We present a dynamical model for the formation and evolution of a massive disk galaxy, within a growing dark halo whose mass evolves according to cosmological simulations of structure formation. The galactic evolution is simulated with a new three-dimensional chemo-dynamical code, including dark matter, stars and a multi-phase ISM. The simulations start at redshift z = 4.85 with a small dark halo in a ΛCDM universe and we follow the evolution until the present epoch. The energy release by massive stars and supernovae prevents a rapid collapse of the baryonic matter and delays the maximum star formation until redshift z ≈ 1. The metal enrichment history in this model is broadly consistent with the evolution of [Zn/H] in damped Lyα systems. The galaxy forms radially from inside-out and vertically from halo to disk. As a function of metallicity, we have described a sequence of populations, reminiscent of the extreme halo, inner halo, metal-poor thick disk, thick disk, thin disk and inner bulge in the Milky Way. The first galactic component that forms is the halo, followed by the bulge, the disk-halo transition region, and the disk. At redshift z ≈ 1, a bar begins to form which later turns into a triaxial bulge. Despite the still idealized model, the final galaxy resembles present-day disk galaxies in many aspects. The bulge in the model consists of at least two stellar subpopulations, an early collapse population and a population that formed later in the bar. The initial metallicity gradients in the disk are later smoothed out by large scale gas motions induced by the bar. There is a pronounced deficiency of low-metallicity disk stars due to pre-enrichment of the disk ISM with metal-rich gas from the bulge and inner disk ("G-dwarf problem"). The mean rotation and the distribution of orbital eccentricities for all stars as a function of metallicity are not very different from those observed in the solar neighbourhood, showing that early homogeneous collapse models are oversimplified. The approach presented here provides a detailed description of the formation and evolution of an isolated disk galaxy in a ΛCDM universe, yielding new information about the kinematical and chemical history of the stars and the interstellar medium, but also about the evolution of the luminosity, the colours and the morphology of disk galaxies with redshift.