A system and method removes well fluids, which include gas and liquids, from a storage tank. The storage tank has a gas relief valve that opens to admit atmospheric air into the storage tank when the pressure of a gas cap decreases below a vacuum threshold pressure. Well fluids flow into the storage tank and the level of liquid is monitored. When the level reaches a first level, a pump is operated by a controller to remove liquid from the storage tank. The pressure in the gas cap is monitored while the pump is operating. The speed of the pump is adjusted to maintain the gas cap pressure above the predetermined pressure and avoid the introduction of atmospheric air into the gas cap.