Metal-halide perovskites are crystalline materials originally developed out of scientific curiosity. Unexpectedly, solar cells incorporating these perovskites are rapidly emerging as serious contenders to rival the leading photovoltaic technologies. Power conversion efficiencies have jumped from 3% to over 20% in just four years of academic research. Here, we review the rapid progress in perovskite solar cells, as well as their promising use in light-emitting devices. In particular, we describe the broad tunability and fabrication methods of these materials, the current understanding of the operation of state-of-the-art solar cells and we highlight the properties that have delivered light-emitting diodes and lasers. We discuss key thermal and operational stability challenges facing perovskites, and give an outlook of future research avenues that might bring perovskite technology to commercialization.