A quantum computer can solve hard problems -such as prime factoring 1,2 , database searching 3,4 , and quantum simulation 5 -at the cost of needing to protect fragile quantum states from error. Quantum error correction 6 provides this protection, by distributing a logical state among many physical qubits via quantum entanglement. Superconductivity is an appealing platform, as it allows for constructing large quantum circuits, and is compatible with microfabrication. For superconducting qubits the surface code 7 is a natural choice for error correction, as it uses only nearest-neighbour coupling and rapidly-cycled entangling gates. The gate fidelity requirements are modest: The per-step fidelity threshold is only about 99%. Here, we demonstrate a universal set of logic gates in a superconducting multi-qubit processor, achieving an average single-qubit gate fidelity of 99.92% and a two-qubit gate fidelity up to 99.4%. This places Josephson quantum computing at the fault-tolerant threshold for surface code error correction. Our quantum processor is a first step towards the surface code, using five qubits arranged in a linear array with nearest-neighbour coupling. As a further demonstration, we construct a five-qubit GreenbergerHorne-Zeilinger (GHZ) state 8,9 using the complete circuit and full set of gates. The results demonstrate that Josephson quantum computing is a high-fidelity technology, with a clear path to scaling up to large-scale, fault-tolerant quantum circuits.The high fidelity performance we demonstrate here is achieved through a combination of highly coherent qubits, a straightforward interconnection architecture, and a novel implementation of the two-qubit controlled-phase (CZ) entangling gate. The CZ gate uses a fast but adiabatic frequency tuning of the qubits 10 , which is easily adjusted yet minimises decoherence and leakage from the computational basis [Martinis, J., et al., in preparation]. We note that previous demonstrations of two-qubit gates achieving better than 99% fidelity used fixed-frequency qubits: Systems based on nuclear magnetic resonance and ion traps have shown two-qubit gates with fidelities of 99.5% 11 and 99.3% 12 . Here, the tuneable nature of the qubits and their entangling gates provides, remarkably, both high fidelity and fast control.Superconducting integrated circuits give flexibility in building quantum systems due to the macroscopic nature of the electron condensate. As shown in Fig. 1, we have designed a processor consisting of five Xmon qubits with nearestneighbour coupling, arranged in a linear array. The crossshaped qubit 14 offers a nodal approach to connectivity while maintaining a high level of coherence (see Supplementary Information for decoherence times). Here, the four legs of the cross allow for a natural segmentation of the design into coupling, control and readout. We chose a modest inter-qubit capacitive coupling strength of g/2π = 30 MHz and use alternating qubit idle frequencies of 5.5 and 4.7 GHz, enabling a CZ gate in 40 ns when two qubits are brough...