A device (FV) for filtering breathing gas has a housing (G) with a gas inlet (GE), a gas outlet (GA) and a filter (F), which is arranged in a first housing section (G1) formed between the gas inlet (GE) and the gas outlet (GA). The housing (G) has a second housing section (G2) gas-tightly separated from the first housing section (G1) with at least one first wall (W1, W2, W3), which establishes a thermal contact with a wall (W1, W2, W3) of the first housing section (G1). The second housing section (G2) has an opening on an outer side of the housing (G).