Device for filling a container with a gas under pressure, especially hydrogen in a tank of a vehicle, comprising at least one source (1, 2, 3, 6) of gas pressurized to a first pressure, called high pressure, a transfer circuit (201, 36, 13, 14, 136, 146) capable of selectively connecting the source or sources (1, 2, 3, 6) of pressurized gas to the tank to be filled, the transfer circuit comprising control members (204, 132, 142) for controlling the flow of the gas from the source or sources (1, 2, 3, 6) to the tank, the transfer circuit further including at least one cooling exchanger (9), for cooling the pressurized gas, wherein the cooling exchanger (9) comprises a hot flow circuit (99) for the pressurized gas to be cooled, a cold flow circuit (98) for a cold cooling fluid, and a refrigeration hold-over medium (5), the refrigeration hold-over medium (5) being in direct heat exchange, on the one hand, with the cold fluid of the cold circuit (98) and, on the other hand, with the pressurized gas to be cooled of the hot circuit (99), in order to selectively carry out indirect heat exchange between the pressurized gas and the cold fluid (4) via the refrigeration hold-over medium (5), and wherein the refrigeration hold-over medium (5) forms and fills a gap (1) between the cold fluid of the cold circuit (98) and the pressurized gas of the hot circuit (99), the gap (1) having a thickness of greater than 5 mm and preferably between 20 and 50 mm.