We study the three-dimensional structure of the Milky Way using 65,981 Mira variable stars discovered by the Optical Gravitational Lensing Experiment survey. The spatial distribution of the Mira stars is analyzed with a model containing three barred components that include the X-shaped boxy component in the Galactic center (GC) and an axisymmetric disk. We take into account the distance uncertainties by implementing the Bayesian hierarchical inference method. The distance to the GC is R
0 = 7.66 ± 0.01(stat.) ± 0.39(sys.) kpc, while the inclination of the major axis of the bulge to the Sun–GC line of sight is θ = 20.°2 ± 0.°6(stat.) ± 0.°7(sys.). We present, for the first time, a detailed three-dimensional map of the Milky Way composed of young and intermediate-age stellar populations. Our analysis provides independent evidence for both the X-shaped bulge component and the flaring disk (being plausibly warped). We provide the complete data set of properties of Miras that were used for calculations in this work. The table includes mean brightness and amplitudes in nine photometric bands (covering a range of wavelengths from 0.5 to 12 μm), photometric chemical type, estimated extinction, and calculated distance with its uncertainty for each Mira variable. The median distance accuracy to a Mira star is at the level of 6.6%.