The need for a single-injection gas chromatographic procedure for detection of the principal atmospheric gases found in environmental samples has led to development of an automated system that permits measurement of CO2, N2O, O-2-Ar, and N-2 in a single detector without interference from water vapor in samples. The injection of gas samples on the system was automated by interfacing a commercial headspace sampler with a gas chromatograph (GC) that was fitted with an ultrasonic detector and two automated multiport switching valves. The first switching valve was configured with short precolumns of Porapak Q (PQ) to retain and vent the water vapor in samples. The other valve was configured with two analytical columns connected in series that permit separation of the gas components. After water is removed by the precolumn, the gas sample Bows onto a PQ column a here CO2 and N2O are retained and separated while the composite peak of N-2 and O-2-Ar elutes onto a molecular sieve (MS) column. The valve is then switched, causing reversal of the order of columns with respect to the gas Row without reversing the direction of Bow through the columns. This allows the CO2 and N2O peaks to elute from the PQ column to the detector while the O-2-Ar and N-2 components are separated on the MS column and later Bow to the detector. The system has proven to be robust in that it permits routine, unattended analyses of moist gas samples with high sensitivity and without interference from water peaks. This, in conjunction with the highly controlled equilibrium conditions permitted by use of the headspace sampler, makes the system suitable for gas analysis of environmental samples including dissolved gas analysis of natural water samples.