In recent years, artificial neural networks have become the flagship algorithm of artificial intelligence 1 . In these systems, neuron activation functions are static and computing is achieved through standard arithmetic operations. By contrast, a prominent branch of neuroinspired computing embraces the dynamical nature of the brain and proposes to endow each component of a neural network with dynamical functionality, such as oscillations, and to rely on emergent physical phenomena, such as synchronization 2-7 , for computing complex problems with small size networks [7][8][9][10][11] . This approach is especially interesting for hardware implementations, as emerging nanoelectronic devices can provide highly compact and energy-efficient non-linear auto-oscillators that mimic the periodic spiking activity of biological neurons [12][13][14][15][16] . The dynamical couplings between oscillators can then be used to mediate the synaptic communication between neurons. However, one major challenge towards implementing these models with nano-devices is to achieve learning, which requires finely controlling and tuning their coupled oscillations 17 . The dynamical features of nanodevices can indeed be difficult to control, and prone to noise and variability 18 . In this work, we show that the outstanding tunability of spintronic nano-oscillators, i.e. the possibility to widely and accurately control their frequency through electrical current and magnetic field, can solve this challenge. We successfully train a hardware network of four spin-torque nano-oscillators to recognize spoken vowels by tuning their frequencies according to an automatic real-time learning rule. We show that the high experimental recognition rates stem from the outstanding ability of these oscillators to synchronize. Our results demonstrate that non-trivial pattern classification tasks can be achieved with small hardware neural networks by endowing them with non-linear dynamical features: here, oscillations and synchronization. This demonstration of real-time learning with an array of four spin-torque nano-oscillators is a milestone for spintronics-based neuromorphic computing.Spin-torque nano-oscillators are natural candidates for building hardware neural networks made of coupled nanoscale oscillators [8][9][10]13,15,18,19 . These nanoscale magnetic tunnel junctions emit microwave