NOVELTY - Water electrolysis is carried out to produce oxygen gas and hydrogen gas. A combustion gas composition (CGC) and the oxygen gas are fed to a combustion chamber (200). An oxygen-based combustion process is maintained for combustion of CGC to provide output power. The combustion process releases a flue gas (104) containing more than 65 vol.% of carbon dioxide. Carbon dioxide and hydrogen gas are combined to form a gas mixture, which is catalytically processed to provide methanol (116).    USE - Generation of methanol and output power, preferably as heat and/or electric energy, in plant.    ADVANTAGE - The method improves overall efficiency, enables careful use of resources, and carries out clean combustion process. The CGC is combusted together with oxygen to produce a clean flue gas. The method provides homogeneous conditions such that the clean combustion process emits no unwanted constituents or by-products, such as nitrogen oxide, carbon monoxide, or soot. The combustion engine can be operated in an ideal operational range. This also leads to an improved efficiency and to a very stable and predictable quality of flue gas. Thermodynamically efficient use of the CGC is enabled.    DETAILED DESCRIPTION - Water electrolysis is carried out to produce oxygen gas and hydrogen gas. A combustion gas composition comprising 40 vol.% or more of hydrocarbon gas and 25 vol.% or more of carbon dioxide, and the oxygen gas are fed at an input side (201) of a combustion chamber. An oxygen-based combustion process is maintained for combustion of CGC in the combustion chamber to provide output power. The combustion process releases a flue gas containing more than 65 vol.% of carbon dioxide at an output side (204). Carbon dioxide and hydrogen gas are combined to form a gas mixture. The gas mixture is fed into a catalytic reactor (220) for carrying out catalytic process which processes the gas mixture to provide methanol. An INDEPENDENT CLAIM is included for plant (100) for generation of methanol and output power, consisting of a water electrolysis facility (210) which can be supplied by electric energy (E4) and water and being designed in order to produce hydrogen gas and oxygen gas, and comprising a hydrogen gas outlet (211) and an oxygen gas outlet (212), a thermal engine with combustion chamber(s) designed for maintaining an oxygen-based combustion process and comprising an input side and a flue gas outlet for releasing a flue gas, a gas connection (250) for feeding oxygen gas from oxygen gas outlet (212) to the input side, a gas connection (202) for feeding CGC and carbon dioxide to input side, a gas mixer (53) for providing a gas mixture, connectable to hydrogen gas outlet, and directly or indirectly connectable to the flue gas outlet, and a catalytic reactor for carrying out catalytic process which processes the gas mixture.    DESCRIPTION OF DRAWING(S) - The drawing shows a functional hardware diagram of the generation of methanol and output power.    Mixer (53)    Plant (100)    Flue gas (104)    Methanol (116)    Combustion chamber (200)    Input side (201)    Gas connections (202,250)    Output side (204)    Unit for removing water and/or microelements (205)    Water electrolysis facility (210)    Hydrogen gas outlet (211)    Oxygen gas outlet (212)    Catalytic reactor (220)    Feed gas inlet (221)    Methanol outlet (222)    Portion of flue gas (254)    Software-based control module (300)    Combined heat and power plant (400)    Control signals (C1-C6)    Combustion gas composition (CGC)    Electric energy (E4)