Method for separating a gas containing carbon dioxide by means of distillation wherein: i) the gas containing at least 50% of carbon dioxide is cooled in a first exchanger so as to produce a cooled fluid, a liquid derived from the cooled fluid is sent to a distillation column to be separated therein, ii) a head gas is withdrawn from the distillation column and the head gas or a gas derived from the head gas is heated in the first exchanger, iii) a tank liquid, which is richer in carbon dioxide than the gas containing at least 50% of carbon dioxide is withdrawn from the distillation column and at least a portion thereof is heated in the first exchanger, iv) at least a first portion of the tank liquid is vaporized in the first exchanger in order to produce a vaporised portion and the vaporised portion is sent back to the column, v) a second portion of the tank liquid is sent to the first exchanger where it is heated and vaporised and the gas formed as such is compressed in order to form a gaseous product rich in carbon dioxide, vi) a portion of the compressed gas forming a cycle gas is cooled and possibly condensed, it is then cooled in the first exchanger forming a liquefied cycle gas, at least one portion of it is expanded and it is sent back to be vaporised in the first exchanger in order to form a refrigeration cycle, and vii) the liquid is derived from the cooled fluid by sending the cooled fluid to a NO x removal column, by taking the head gas from the removal column and by sending it to at least one phase separator and by taking the liquid derived from the cooled fluid in one of the phase separators characterised in that the NO x removal column is a stripping column, supplied at the head with liquefied cycle gas. i) the gas containing at least 50% of carbon dioxide is cooled in a first exchanger so as to produce a cooled fluid, a liquid derived from the cooled fluid is sent to a distillation column to be separated therein, ii) a head gas is withdrawn from the distillation column and the head gas or a gas derived from the head gas is heated in the first exchanger, iii) a tank liquid, which is richer in carbon dioxide than the gas containing at least 50% of carbon dioxide is withdrawn from the distillation column and at least a portion thereof is heated in the first exchanger, iv) at least a first portion of the tank liquid is vaporized in the first exchanger in order to produce a vaporised portion and the vaporised portion is sent back to the column, v) a second portion of the tank liquid is sent to the first exchanger where it is heated and vaporised and the gas formed as such is compressed in order to form a gaseous product rich in carbon dioxide, vi) a portion of the compressed gas forming a cycle gas is cooled and possibly condensed, it is then cooled in the first exchanger forming a liquefied cycle gas, at least one portion of it is expanded and it is sent back to be vaporised in the first exchanger in order to form a refrigeration cycle, and vii) the liquid is derived from the cooled fluid by sending the cooled fluid to a NO x removal column, by taking the head gas from the removal column and by sending it to at least one phase separator and by taking the liquid derived from the cooled fluid in one of the phase separators characterised in that the NO x removal column is a stripping column, supplied at the head with liquefied cycle gas.