Single-photon detection is an essential component in many experiments in quantum optics, but it remains challenging in the microwave domain. We realize a quantum nondemolition detector for propagating microwave photons and characterize its performance using a single-photon source. To this aim, we implement a cavity-assisted conditional phase gate between the incoming photon and a superconducting artificial atom. By reading out the state of this atom in a single shot, we reach an external (internal) photon-detection fidelity of 50% (71%), limited by transmission efficiency between the source and the detector (75%) and the coherence properties of the qubit. By characterizing the coherence and average number of photons in the field reflected off the detector, we demonstrate its quantum nondemolition nature. We envisage applications in generating heralded remote entanglement between qubits and for realizing logic gates between propagating microwave photons. DOI: 10.1103/PhysRevX.8.021003 Subject Areas: Quantum Physics, Quantum InformationSingle-photon detectors [1] for itinerant fields are a key element in remote entanglement protocols [2], in linear optics quantum computation [3,4], and, in general, in characterizing correlation properties of radiation fields [5]. While such detectors are well established at optical frequencies, their microwave equivalents are still under development, partly because of the much lower photon energy in this frequency band [6]. At microwave frequencies, itinerant fields are typically recorded with linear detection schemes [7], analogous to optical homodyne detection. Such detection can now be realized with high efficiency by employing near-quantum-limited parametric amplifiers [8], and furthermore, it allows for a full tomographic characterization of radiation fields [9]. However, protocols such as entanglement heralding require the intrinsic nonlinearity of a single-photon detector in order to yield high-purity states despite losses between the source and the detector. Such a component has therefore raised interest in the community, leading to a variety of theoretical proposals [10][11][12][13][14][15][16][17][18][19][20], as well as initial experimental demonstrations, in the last decade [21][22][23][24][25][26][27].The first microwave photodetection experiment with superconducting circuits that did not require photons to be stored in high-quality factor cavities [21-23] was based on current biased Josephson junctions [24], but it was destructive and involved a long dead time. Later, systems involving absorption into artificial atoms (and thus destruction) of traveling photons [25,26] were implemented. Very recently, a quantum nondemolition (QND) detection scheme based on a photon-qubit entangling gate, similar in spirit to this work, was implemented using a strong dispersive shift in a 3D cavity [27]. Projective measurements of coherent input states into single-photon Fock states were realized in that work [27].Here, we demonstrate single-shot QND detection of itinerant single ph...