An apparatus for the separation of a gas containing carbon dioxide, carbon monoxide, water and nitrogen, comprising a unit for separation by adsorption or by permeation, a means for sending the gas to be separated in the separation unit in order to produce a gas enriched in carbon monoxide and depleted in carbon dioxide and a gas depleted in carbon monoxide and enriched in carbon dioxide, a dryer, a compressor, a means for sending the gas enriched in carbon dioxide to be dried in the dryer and compressed in the compressor, a first means for cooling by indirect heat exchange with at least one gas originating from a distillation column, no liquid originating from the column participating in the heat exchange, a second means for cooling by indirect heat exchange with the bottom liquid from the distillation column, a third means for cooling by heat exchange with a first closed-circuit ammonia refrigeration cycle, a fourth means for cooling by heat exchange with a second closed-circuit CO2 or propane refrigeration cycle, means for sending the gas compressed in the compressor successively to the first, to the second, to the third and to the fourth cooling means, being partially condensed by the last of the refrigeration cycles, a phase separator, a means for sending the partially condensed gas to the phase separator, a means for expanding the liquid from the phase separator and for sending the expanded liquid to the top of the distillation column in order to be separated therein, without having been heated upstream of the expansion, and means for sending the gas from the phase separator to be heated by indirect heat exchange with the dried and compressed gas enriched in carbon dioxide, a means for sending the bottom liquid vaporized by the heat exchange with the gas to the bottom of the column as sole reboiling gas and means for extracting a CO2-rich liquid at the bottom of the column.