Micrometre-scale superconducting circuits are at present explored as the building blocks for scalable quantum information processors. In a system where two such qubits are coupled to a resonant cavity, tripartite interactions and controlled coherent dynamics have now been demonstrated. This platform should allow for a fuller exploration of multipartite quantum states and their deterministic preparation. Multipartite entanglement is essential for quantum computation1 and communication2,3,4, and for fundamental tests of quantum mechanics5 and precision measurements6. It has been achieved with various forms of quantum bits (qubits), such as trapped ions7,8, photons9 and atoms passing through microwave cavities10. Quantum systems based on superconducting circuits, which are potentially more scalable, have been used to control pair-wise interactions of qubits11,12,13,14,15,16 and spectroscopic evidence for three-particle entanglement was observed17,18. Here, we report the demonstration of coherent interactions in the time domain for three directly coupled superconducting quantum systems, two phase qubits and one resonant cavity. We provide evidence for the deterministic evolution from a simple product state, through a tripartite W state, into a (bipartite) Bell state. The cavity can be thought of as a multiphoton register or an entanglement bus, and arbitrary preparation of multiphoton states in this cavity using one of the qubits19 and subsequent interactions for entanglement distribution should allow for the deterministic creation of another class of entanglement, a Greenberger–Horne–Zeilinger state.