Photon-mediated interactions between atoms are of fundamental importance in quantum optics, quantum simulations, and quantum information processing. The exchange of real and virtual photons between atoms gives rise to nontrivial interactions, the strength of which decreases rapidly with distance in three dimensions. Here, we use two superconducting qubits in an open one-dimensional transmission line to study much stronger photon-mediated interactions. Making use of the possibility to tune these qubits by more than a quarter of their transition frequency, we observe both coherent exchange interactions at an effective separation of 3λ/4 and the creation of super- and subradiant states at a separation of one photon wavelength λ. In this system, collective atom-photon interactions and applications in quantum communication may be explored.