Quantum logic gates are fundamental building blocks of quantum computers.
Their integration into quantum networks requires strong qubit coupling to
network channels, as can be realized with neutral atoms and optical photons in
cavity quantum electrodynamics. Here we demonstrate that the long-range
interaction mediated by a flying photon performs a gate between two stationary
atoms inside an optical cavity from which the photon is reflected. This single
step executes the gate in 2μs. We show an entangling operation
between the two atoms by generating a Bell state with 76(2)% fidelity. The gate
also operates as a CNOT. We demonstrate 74.1(1.6)% overlap between the observed
and the ideal gate output, limited by the state preparation fidelity of
80.2(0.8)%. As the atoms are efficiently connected to a photonic channel, our
gate paves the way towards quantum networking with multiqubit nodes and the
distribution of entanglement in repeater-based long-distance quantum networks.Comment: 10 pages including appendix, 5 figure