Abstract The Schmidt law (SF law) in the Milky Way was investigated using 3D distribution maps of H ii regions and H i and molecular (H2) gases with spatial resolutions of ∼1 kpc in the Galactic plane and a few tens of pc in the vertical direction. H ii regions were shown to be distributed in a star-forming (SF) disk with nearly constant vertical full thickness 92 pc in spatial coincidence with the molecular gas disk. The vertically averaged volume star formation rate (SFR) ρSFR in the SF disk is related to the surface SFR ΣSFR by ρSFR/[M⊙ yr−1 kpc−3] = 9.26 × ΣSFR/[M⊙ yr−1 kpc−2]. The SF law fitted by a single power law of gas density in the form of $\Sigma _{\rm SFR}\propto \rho _{\rm SFR}\propto \rho _{\rm gas}^\alpha$ and $\propto \Sigma _{\rm gas}^\beta$ showed indices of α =0.78 ± 0.05 for $\rho _{\rm H_2}$ and 2.15 ± 0.08 for ρtotal, and β = 1.14 ± 0.23 for Σtotal, where ρ and Σ denote volume and surface densities, respectively. The star formation rate is shown to be directly related to the molecular gas, but indirectly to H i and total gas densities. The dependence of the SF law on the gaseous phase is explained by the phase transition theory between H i and H2.