An apparatus for separating CO2 from a feed stream containing at least CO2 and at least one lighter component chosen among oxygen, nitrogen, argon, methane, CO and hydrogen and at least one component heavier than CO2, comprising a heat exchanger (E1), means for separation of the cooled feed stream by partial condensation (S1) and/or distillation (K1), means for sending the feed stream to be cooled in the heat exchanger (E1) to a temperature less than −30° C. or less than −45° C., preferably as low as-55° C., means for sending cooled feed stream from the heat exchanger to the separation means to be separated by partial condensation (S1) and/or distillation (K1) producing a first liquid enriched in CO2 and the at least one heavier component and depleted in the at least one lighter component and a first gas depleted in CO2 and the at least one heavier component and enriched in the at least one lighter component, expansion means, means for sending at least part of the first liquid to be expanded in the expansion means, said expansion producing a second liquid, means for sending the second liquid to be at least partially vaporized in the heat exchanger (E1) or an auxiliary heat exchanger (E2) producing a second gas, a compressor (C1, C2), means for sending the second gas to the compressor to be compressed gas up to above 8bara, preferably above 15 bara forming a compressed second gas, means for sending the compressed second gas from the compressor to the heat exchanger to be cooled, a scrubber column (K2), means for sending the compressed cooled second gas from the heat exchanger to the bottom of the scrubber column, a conduit for sending liquid CO2 to the top of the scrubber column, means for removing a bottom liquid of the scrubber column enriched in the at least one heavier component and containing carbon dioxide and for removing a top gas of the scrubber column depleted in the at least one heavier component.