The invention relates to a method of generating oxygen. The method comprises the steps of: intermittently guiding a stream of oxygen comprising gas through at least one adsorption chamber (12) being equipped with an oxygen separation adsorbent (16), thereby defining an adsorption mode and a desorption mode of the at least one adsorption chamber (12), and thereby enriching the oxygen comprising gas with respect to oxygen, guiding the enriched oxygen comprising gas to a primary side of a dense membrane (52), heating the dense membrane(52) to a temperature at which it is permeable for oxygen, generating an oxygen flow through the dense membrane (52) to its secondary side, thereby separating the oxygen from the enriched oxygen comprising gas and forming a stream of oxygen. According to the invention, the invention further comprises the step of guiding at least a part of the generated oxygen through the at least one adsorption chamber (12) being in desorption mode. The method according to the invention allows generating oxygen in a high purity, thereby being energy saving, cost saving and being performable in a compact device.