The spin torque effect that occurs in nanometre-scale magnetic multilayer devices can be used to generate steady-state microwave signals in response to a d.c. electrical current. This establishes a new functionality for magneto-electronic structures that are more commonly used as magnetic field sensors and magnetic memory elements. The microwave power emitted from a single spin torque nano-oscillator (STNO) is at present typically less than 1 nW. To achieve a more useful power level (on the order of microwatts), a device could consist of an array of phase coherent STNOs, in a manner analogous to arrays of Josephson junctions and larger semiconductor oscillators. Here we show that two STNOs in close proximity mutually phase-lock-that is, they synchronize, which is a general tendency of interacting nonlinear oscillator systems. The phase-locked state is distinct, characterized by a sudden narrowing of signal linewidth and an increase in power due to the coherence of the individual oscillators. Arrays of phase-locked STNOs could be used as nanometre-scale reference oscillators. Furthermore, phase control of array elements (phased array) could lead to nanometre-scale directional transmitters and receivers for wireless communications.