A method for purifying gas, in which a gas is treated in a multistage treatment comprising at least two ejector stages (3,9), wherein the method comprises - injecting a motive medium which comprises liquid at high pressure, in which pressure of the motive medium is 1.3-100 bar, to at least one ejector of the first ejector stage, and sucking the gas into the same ejector in which the gas is mixed with the motive medium for forming a mixture comprising a gas phase and a liquid phase, - arranging the mixture to flow through a pipe or tube which has enough residence time to allow dissolving a desired part of the gas into the liquid after the ejector stage, - supplying the mixture comprising the gas phase and the liquid phase to a first separation stage arranged after the first ejector stage, and separating the gas phase and the liquid phase in the first separation stage, - supplying at least a part of gas phase to a second or later ejector stage which comprises at least one ejector so that a second or later motive medium which comprises liquid is injected to the ejector and the gas phase is sucked into the same ejector in which the gas phase is mixed with the second or later motive medium for forming a second or later mixture, - supplying the second mixture comprising a gas phase and a liquid phase to a second separation stage arranged after the second ejector stage, and separating the gas phase and the liquid phase in the second separation stage, and forming a purified gas, and supplying at least a part of the liquid phase back to the first separation stage, and - supplying the liquid phase from the first separation stage to a regeneration stage, and treating at least a part of the liquid phase by a regeneration in the regeneration stage for removing carbon dioxide and other impurities from the liquid phase after the first separation stage, and supplying at least a part of the liquid phase from the regeneration stage to the motive medium of the first ejector stage, and the regeneration is carried out under vacuum, wherein - the gas is compressed by the motive medium (2,8) in the ejectors so that pressure of the gas is increased to a first pressure level in the first ejector stage and pressure of the gas is increased from the previous pressure level to a second or later pressure level in the second or later ejector stage, and - the mixture and the second or later motive medium comprise an additive for removing impurities of the gas, and the additive (14,15) is added for increasing a bonding of desired impurities to the liquid and/or increasing a capture of desired impurities in each separation stage. - injecting a motive medium which comprises liquid at high pressure, in which pressure of the motive medium is 1.3-100 bar, to at least one ejector of the first ejector stage, and sucking the gas into the same ejector in which the gas is mixed with the motive medium for forming a mixture comprising a gas phase and a liquid phase, - arranging the mixture to flow through a pipe or tube which has enough residence time to allow dissolving a desired part of the gas into the liquid after the ejector stage, - supplying the mixture comprising the gas phase and the liquid phase to a first separation stage arranged after the first ejector stage, and separating the gas phase and the liquid phase in the first separation stage, - supplying at least a part of gas phase to a second or later ejector stage which comprises at least one ejector so that a second or later motive medium which comprises liquid is injected to the ejector and the gas phase is sucked into the same ejector in which the gas phase is mixed with the second or later motive medium for forming a second or later mixture, - supplying the second mixture comprising a gas phase and a liquid phase to a second separation stage arranged after the second ejector stage, and separating the gas phase and the liquid phase in the second separation stage, and forming a purified gas, and supplying at least a part of the liquid phase back to the first separation stage, and - supplying the liquid phase from the first separation stage to a regeneration stage, and treating at least a part of the liquid phase by a regeneration in the regeneration stage for removing carbon dioxide and other impurities from the liquid phase after the first separation stage, and supplying at least a part of the liquid phase from the regeneration stage to the motive medium of the first ejector stage, and the regeneration is carried out under vacuum, wherein - the gas is compressed by the motive medium (2,8) in the ejectors so that pressure of the gas is increased to a first pressure level in the first ejector stage and pressure of the gas is increased from the previous pressure level to a second or later pressure level in the second or later ejector stage, and - the mixture and the second or later motive medium comprise an additive for removing impurities of the gas, and the additive (14,15) is added for increasing a bonding of desired impurities to the liquid and/or increasing a capture of desired impurities in each separation stage.