A device for providing ventilation gas to a patient during a cardiopulmonary resuscitation cycle in which compression of a thorax of the patient is performed cyclically including a compression stroke and a decompression stroke, defining a cycle time for supplying oxygenated blood to the heart, said device comprising: a gas supply tube having a distal end; a source of gas for supplying said ventilation gas to a proximal end of said gas supply tube for delivery of said ventilation gas at the distal end of the gas supply tube; a switch valve for initiating and terminating the supply of gas via the gas supply tube; a control device for receiving a synchronization signal based on a said cardiopulmonary resuscitation cycle; wherein said cardiopulmonary resuscitation cycle is provided by a mechanical cardiopulmonary resuscitation device comprising a cup shaped member, which is operated by a drive mechanism, so that when the drive mechanism is operated, the cup shaped member compresses the thorax of the patient in said compression stroke; characterized in that said device is operated for synchronizing said operation oft he switch valve with said cardiopulmonary resuscitation cycle based on said synchronization signal so that the switch valve operates with the same cycle time as the cardiopulmonary resuscitation cycle time but off-set in relation to the cardiopulmonary resuscitation cycle; wherein said distal end of said gas supply tube is arranged in a trachea of the patient; and in that said off-set is arranged so that that the following actions takes place: said control device is configured to initiate the supply of gas based on the synchronization signal so that the gas supply is initiated between 25% and 2% of the cycle time before the start of a compression stroke or between 25% and 48% of the cycle time after the termination of a compression stroke; and said control device is configured to terminate the supply of gas based on the synchronization signal so that the gas supply is terminated between 2% and 30% of the cycle time after the start of a compression stroke or between 52% and 80% of the cycle time after the termination of a compression stroke. a gas supply tube having a distal end; a source of gas for supplying said ventilation gas to a proximal end of said gas supply tube for delivery of said ventilation gas at the distal end of the gas supply tube; a switch valve for initiating and terminating the supply of gas via the gas supply tube; a control device for receiving a synchronization signal based on a said cardiopulmonary resuscitation cycle; wherein said cardiopulmonary resuscitation cycle is provided by a mechanical cardiopulmonary resuscitation device comprising a cup shaped member, which is operated by a drive mechanism, so that when the drive mechanism is operated, the cup shaped member compresses the thorax of the patient in said compression stroke; characterized in that said device is operated for synchronizing said operation oft he switch valve with said cardiopulmonary resuscitation cycle based on said synchronization signal so that the switch valve operates with the same cycle time as the cardiopulmonary resuscitation cycle time but off-set in relation to the cardiopulmonary resuscitation cycle; wherein said distal end of said gas supply tube is arranged in a trachea of the patient; and in that said off-set is arranged so that that the following actions takes place: said control device is configured to initiate the supply of gas based on the synchronization signal so that the gas supply is initiated between 25% and 2% of the cycle time before the start of a compression stroke or between 25% and 48% of the cycle time after the termination of a compression stroke; and said control device is configured to terminate the supply of gas based on the synchronization signal so that the gas supply is terminated between 2% and 30% of the cycle time after the start of a compression stroke or between 52% and 80% of the cycle time after the termination of a compression stroke. said control device is configured to initiate the supply of gas based on the synchronization signal so that the gas supply is initiated between 25% and 2% of the cycle time before the start of a compression stroke or between 25% and 48% of the cycle time after the termination of a compression stroke; and said control device is configured to terminate the supply of gas based on the synchronization signal so that the gas supply is terminated between 2% and 30% of the cycle time after the start of a compression stroke or between 52% and 80% of the cycle time after the termination of a compression stroke.