During the past decade, research into superconducting quantum bits (qubits) based on Josephson junctions has made rapid progress1. Many foundational experiments have been performed2–8, and superconducting qubits are now considered one of the most promising systems for quantum information processing. However, the experimentally reported coherence times are likely to be insufficient for future large-scale quantum computation. A natural solution to this problem is a dedicated engineered quantum memory based on atomic and molecular systems. The question of whether coherent quantum coupling is possible between such natural systems and a single macroscopic artificial atom has attracted considerable attention9–12 since the first demonstration of macroscopic quantum coherence in Josephson junction circuits2. Here we report evidence of coherent strong coupling between a single macroscopic superconducting artificial atom (a flux qubit) and an ensemble of electron spins in the form of nitrogen–vacancy colour centres in diamond. Furthermore, we have observed coherent exchange of a single quantum of energy between a flux qubit and a macroscopic ensemble consisting of about 33107 such colour centres. This provides a foundation for future quantum memories and hybrid devices coupling microwave and optical systems.