A process for capturing at least one mercury or arsenic heavy metal, contained in a moist gas that is a natural gas, a shale gas, a coal gas, a synthesis gas, combustion fumes, a gaseous hydrocarbon effluent, or rare earth production exhaust gas, comprising water vapor, consisting of:
- a) introducing the moist gas into a primary gas-liquid separator (6) separating a liquid stream comprising water and hydrocarbon from the moist gas to produce an effluent moist gas,
- b) cooling (1000) the effluent moist gas by heat exchange with a heat transfer fluid produced in e) in order to obtain a gas cooled to a temperature Tf, the heat transfer fluid being vaporized during b);
- c) separating (2000) at least a portion of condensed water contained in the cooled gas obtained in b in a manner such as to obtain a gas which is depleted in water and a liquid stream containing water;
- d) compressing (4000) the vaporized heat transfer fluid obtained from b) in a manner such as to obtain a compressed heat transfer fluid;
- e) heating (1002) the water-depleted gas by heat exchange with the compressed heat transfer fluid obtained in d) in order to obtain a cooled heat transfer fluid and a gas reheated to a temperature Tc, the temperature Tc being determined in a manner such that the reheated moist gas obtained in e) has a relative humidity of less than 75% in which the difference between Tc and Tf is less than 20° C.;
- f) decompressing (5000) the cooled heat transfer fluid obtained in e, the decompressed heat transfer fluid being recycled to b);
- g) bringing the reheated gas obtained in e into contact (3000) with a capture mass for said heavy metal in order to obtain a gas depleted in heavy metal.