ALTHOUGH stars form from clouds of gas and dust, there are insignifica
nt amounts of gas around ordinary (Sun-like) stars. This suggests that
hydrogen and helium, the primary constituents of planets such as Jupi
ter and Saturn, are not easily retained in orbit as a star matures. Th
e gas-giant planets in the Solar System must therefore have formed rap
idly. Models of their formation generally suggest that a solid core fo
rmed in less than or equal to 10(6) yr, followed by the accretion of t
he massive gaseous envelope in similar to 10(7) yr (refs 1-5). But how
and when the gas of the solar nebula dissipated, and how this compare
s with the predicted timescale of gas-giant formation, remains unclear
(6,7), in part because direct observations of circumstellar gas have b
een made only for stars either younger or older than the critical rang
e of 10(6)-10(7) yr (refs 8-15). Here we report observations of the mo
lecular gas surrounding 20 stars whose ages are likely to be in this r
ange. The gas dissipates rapidly; after a few million years the mass r
emaining is typically much less than the mass of Jupiter. Thus, if gas
-giant planets are common in the Galaxy, they must form even more quic
kly than present models suggest.