A method of controlling an internal combustion engine system comprising a combustor, an expander, and an exhaust guide arranged to guide exhaust gases from the combustor to the expander, the method comprising - introducing air into the combustor, - providing a first fuel injection, - allowing at least a portion of the fuel from the first fuel injection to be combusted in the combustor in the air introduced to the combustor, - allowing a first expansion in the combustor of the combusted fuel and air, - allowing exhaust gases produced by the combustion to be guided to the expander, - allowing a second expansion of the received exhaust gases in the expander, - providing a second fuel injection after the first expansion into the exhaust guide, and/or providing a second fuel injection into the combustor after the combustion and before an introduction of air into the combustor for a subsequent combustion in the combustor, - allowing the exhaust gases produced by the combustion to be guided to a pre-expander exhaust treatment device (7, 8) in the exhaust guide, and allowing (S9, S12) the pre-expander exhaust treatment device (7, 8) to provide an exhaust treatment process to the received exhaust gases, the second fuel injection being provided upstream of the pre-expander exhaust treatment device (7, 8), - characterized in that the expander comprises a cylinder and a piston arranged to reciprocate in the cylinder, the piston being connected to a crankshaft of the engine system, - wherein allowing (S9, S12) the pre-expander exhaust treatment device (7, 8) to provide an exhaust treatment process comprises allowing nitrogen oxides (NOx) in the received exhaust gases to be stored in the pre-expander exhaust treatment device (7, 8), - wherein the exhaust treatment process comprises a reaction of fuel from the second fuel injection with air in the received exhaust gases and at least a portion of the stored nitrogen oxides (NOx) to produce nitrogen, - the method comprising repeating a plurality of times the steps of providing a second fuel injection and allowing stored nitrogen oxides (NOx) to build up in the pre-expander exhaust treatment device (7, 8) between each of the second fuel injections. - introducing air into the combustor, - providing a first fuel injection, - allowing at least a portion of the fuel from the first fuel injection to be combusted in the combustor in the air introduced to the combustor, - allowing a first expansion in the combustor of the combusted fuel and air, - allowing exhaust gases produced by the combustion to be guided to the expander, - allowing a second expansion of the received exhaust gases in the expander, - providing a second fuel injection after the first expansion into the exhaust guide, and/or providing a second fuel injection into the combustor after the combustion and before an introduction of air into the combustor for a subsequent combustion in the combustor, - allowing the exhaust gases produced by the combustion to be guided to a pre-expander exhaust treatment device (7, 8) in the exhaust guide, and allowing (S9, S12) the pre-expander exhaust treatment device (7, 8) to provide an exhaust treatment process to the received exhaust gases, the second fuel injection being provided upstream of the pre-expander exhaust treatment device (7, 8), - characterized in that the expander comprises a cylinder and a piston arranged to reciprocate in the cylinder, the piston being connected to a crankshaft of the engine system, - wherein allowing (S9, S12) the pre-expander exhaust treatment device (7, 8) to provide an exhaust treatment process comprises allowing nitrogen oxides (NOx) in the received exhaust gases to be stored in the pre-expander exhaust treatment device (7, 8), - wherein the exhaust treatment process comprises a reaction of fuel from the second fuel injection with air in the received exhaust gases and at least a portion of the stored nitrogen oxides (NOx) to produce nitrogen, - the method comprising repeating a plurality of times the steps of providing a second fuel injection and allowing stored nitrogen oxides (NOx) to build up in the pre-expander exhaust treatment device (7, 8) between each of the second fuel injections.