A liquid trap for removing liquid such as condensed water vapor from gas in a patient's sampled airstream. The liquid trap includes a separation chamber that is used to separate the liquid from the gas. An opening in the separation chamber allows the liquid to flow into a collection chamber where it is temporarily stored. The collection chamber has a purge port that allows the chamber to be emptied of liquid without removing the chamber from a gas analyzer. A check valve is coupled to the purge port to retain the liquid in the collection chamber. Electrodes sense when the liquid reaches a predetermined level. A vacuum is applied to the check valve to remove the liquid from the collection chamber through the purge port.