Dephasing induced by residual thermal photons in the readout resonator is a leading factor limiting the coherence times of qubits in the circuit QED architecture. This residual thermal population, of the order of 10 −1 -10 −3 , is suspected to arise from noise impinging on the resonator from its input and output ports. To address this problem, we designed and tested a new type of band-pass microwave attenuator that consists of a dissipative cavity well thermalized to the mixing chamber stage of a dilution refrigerator. By adding such a cavity attenuator inline with a 3D superconducting cavity housing a transmon qubit, we have reproducibly measured increased qubit coherence times. At base temperature, through Hahn echo experiment, we measured T2e/2T1 = 1.0 (+0.0/−0.1) for two qubits over multiple cooldowns. Through noise-induced dephasing measurement, we obtained an upper bound 2 × 10 −4 on the residual photon population in the fundamental mode of the readout cavity, which to our knowledge is the lowest value reported so far. These results validate an effective method for protecting qubits against photon noise, which can be developed into a standard technology for quantum circuit experiments.