We report a generic scheme to implement transmission-type quantum gates for propagating microwave photons, based on a sequence of lumped-element components on transmission lines. By choosing three equidistant superconducting quantum interference devices (SQUIDs) as the components on a single transmission line, we experimentally implement a magnetic-flux-tunable phase shifter and demonstrate that it produces a broad range of phase shifts and full transmission within the experimental uncertainty. Together with previously demonstrated beam splitters, these phase shifters can be utilized to implement arbitrary single-qubit gates. Furthermore, we theoretically show that replacing the SQUIDs by superconducting qubits, the phase shifter can be made strongly nonlinear, thus introducing deterministic photon–photon interactions. These results critically complement the previous demonstrations of on-demand single-photon sources and detectors, and hence pave the way for an all-microwave quantum computer based on propagating photons.