Magnetic reconnection is a fundamental process in laboratory, magnetospheric, solar and astrophysical plasmas, whereby magnetic energy is converted into heat, bulk kinetic energy and fast particle energy. Its nature in two dimensions is much better understood than that in three dimensions, where its character is completely different and has many diverse aspects that are currently being explored. Here, we focus on the magnetohydrodynamics of three-dimensional reconnection in the plasma environment of the Solar System, especially solar flares. The theory of reconnection at null points, separators and quasi-separators is described, together with accounts of numerical simulations and observations of these three types of reconnection. The distinction between separator and quasi-separator reconnection is a theoretical one that is unimportant for the observations of energy release. A new paradigm for solar flares, in which three-dimensional reconnection plays a central role, is proposed.