The number of superconducting qubits contained in a single quantum processor is increasing steadily. However, to realize a truly useful quantum computer, it is inevitable to increase the number of qubits much further by distributing quantum information among distant processors using flying qubits. Here, we demonstrate a key element towards this goal, namely, a SWAP gate between the superconducting-atom and microwave-photon qubits. The working principle of this gate is the single-photon Raman interaction, which results from strong interference in one-dimensional optical systems and enables a high gate fidelity insensitively to the pulse shape of the photon qubit, by simply bouncing the photon qubit at a cavity attached to the atom qubit. We confirm the bidirectional quantum state transfer between the atom and photon qubits. The averaged fidelity of the photon-to-atom (atom-to-photon) state transfer reaches 0.829 (0.801), limited mainly by the energy relaxation time of the atom qubit. The present atom-photon gate, equipped with an in situ tunability of the gate type, would enable various applications in distributed quantum computation using superconducting qubits and microwave photons.