Phase equilibria in the Mg-rich region of the Mg-Sn-Ag ternary system were determined by quenching experiments, differential scanning calorimetry, electron probe micro-analysis, and Xray diffraction techniques. No ternary compounds were found in the studied isothermal sections. A critical evaluation of the available experimental data and a thermodynamic optimization of the Mg-Sn-Ag-In quaternary system were carried out using the calculation of phase diagrams method. The modified quasichemical model in the pair approximation was used for the liquid solution, which exhibits a high degree of short-range order. The solid phases were modeled with the compound energy formalism. All available and reliable experimental data were reproduced within experimental error limits. A self-consistent thermodynamic database was constructed for the Mg-Sn-Ag-In quaternary system, which can be used as a guide for Mg-based alloys development.