The stationary functional of the all-electron density functional plus dynamical mean field theory (DFT+DMFT) formalism to perform free energy calculations and structural relaxations is implemented for the first time. Here, the first order error in the density leads to a much smaller, second order error in the free energy. The method is applied to several well known correlated materials; metallic SrVO3, Mott insulating FeO, and elemental Cerium, to show that it predicts the lattice constants with very high accuracy. In Cerium, we show that our method predicts the iso-structural transition between the α and γ phases, and resolve the long standing controversy in the driving mechanism of this transiton. PACS numbers: 71.27.+a,71.30.+h Prediction of the crystal structures of solids by large scale quantum mechanical simulations is one of the fundamental problems of condensed matter physics, and occupies a central place in materials design. The workhorse of the field is the Density Functional Theory (DFT) [1] at the level of Local Density Approximation (LDA) or Generalized Gradient Approximations (GGAs), which predict lattice constants of weakly correlated materials typically within ∼1% relative error [2].These errors of DFT in LDA/GGA implementations are an order of magnitude larger in the so called correlated materials: For example, the lattice constant of δ-Pu is underestimated by 11% [3] or non-magnetic FeO by 7% [4]. While GGAs and hybrid functionals can sometimes improve upon conventional LDA, these functionals many times degrade the agreement between predicted and experimentally determined bulk moduli and lattice constants, in particular in materials containing heavy elements. [2] To account for the correlation effects, more sophisticated many body methods have been developed. Among them, one of the most successful algorithms is the dynamical mean-field theory (DMFT) [5]. It replaces the problem of describing correlation effects in a periodic lattice by a strongly interacting impurity coupled to a self-consistent bath [6]. To become material specific, DMFT was soon developed into an electronic structure tool (LDA+DMFT) [7, 8], which achieved great success in numerous correlated materials (for a review see [9]). The LDA+DMFT method has mainly been used for the calculation of spectroscopic quantities, and only a few dozens of studies managed to compute energetics of correlated solids, and only a handful of them used exact solvers and charge self-consistency [18,19,24,25,28,29]. This is not only because of the very high computational cost, but also because previous implementations of LDA+DMFT were not stationary, and hence it was hard to achieve precision of free energies needed for structure optimization and study of phase transitions in solids.Here we implemented the LDA+DMFT functional, which delivers stationary free energies at finite temperatures. This stationarity is crucial for practical implementation and precision of computed energies, since the first order error in the density ρ (or the Green's fu...