A method for estimating the S-wave velocity (VS) profile of subsurface soils is proposed, based on inversion of the horizontal-to-vertical (H/V) spectrum of microtremors observed with a three-component sensor. For this purpose, theoretical formulas are derived for computing the H/V spectrum of surface waves propagating on a layered half-space in which the effects of the fundamental and higher modes are taken into account. An inverse analysis using microtremor H/V spectrum is then presented for estimating S-wave velocity profiles of subsurface soils. Assuming that either the VS values or the thicknesses of the shallow soil layers are known, the remaining unknowns are sought. The inverse analyses are performed using the H/V spectra observed at six sites, and their shallow VS profiles are estimated. The inverted S-wave velocity profiles are consistent with available downhole velocity logs at the sites. The standard error ratios of the inverted values are less than about 0.1, with a maximum of 0.2.