We have solved and refined the crystal structure of the orthorhombic gamma-phase of Ca(BD4)(2) by combined synchrotron X-ray powder diffraction, neutron powder diffraction, and ab initio calculations. Among five structural candidates giving the same quality of the fit of the diffraction data, the structural model with the highest symmetry and space group Pbca is the most appropriate. This is supported by the implicit presence of the Pbca symmetry operations in the low-symmetry space groups in both experimental and DFT calculated structures. The Ca atoms are surrounded by six BD4 groups that have similar distortions as reported for the beta-phase of Ca(BD4)(2). On the basis of the experimental structures, free energies of the alpha-, beta-, and gamma-phases are calculated in the range 300 K < T < 620 K. The phase transitions are observed in the same temperature range by means of X-ray diffraction on Ca(BD4)(2) + MgD2 and pure Ca(BD4)(2) samples. According to the ab initio calculations, the alpha-phase is the ground state at 0 K. At room temperature, the calculated free energies of the alpha-phase, beta-phase, and gamma-phase were found to be within similar to 0.13 eV/f.u., in agreement with the observed coexistence of these phases. Moreover, calculations provide insight into trends for relative stabilities of alpha-, beta-, and gamma-phases. That is, with increasing temperature, the beta-phase becomes more stable, while the metastable gamma-phase becomes more destabilized with respect to the alpha-phase.