In a recent publication \cite{us}, a cosmological scenario featuring a scalar field, φ, that is a source for Dark Matter and Dark Energy has been proposed. In this paper, a concrete realization of that scenario is presented. As in many models of scalar-field driven Dark Energy, the effective Lagrangian of the field φ contains a potential proportional to e^{-\varphi/f}. This potential is modulated in such a way that, in the absence of other matter fields, it has a local minimum at a small value of φ. Fluctuations of φ around this minimum give rise to a gas of dark-matter particles. The field φ is coupled to another scalar field χ in such a way that the minimum in the effective potential of φ disappears when, after a continuous phase transition accompanied by spontaneous symmetry breaking, χ develops a non-vanishing expectation value. This triggers slow growth of a homogeneous component of φ accompanied by the emergence of Dark Energy, a phenomenon analogous to the "wetting transition" in statistical mechanics. Inside regions of the Universe where the pressure is small and the energy density is large enough to stall expansion, in particular around galaxies and galaxy clusters, the phase transition in the state of χ does not take place, and a gas of cold dark-matter particles persists. The evolution of φ at very early times may tune the rate of baryogenesis.