Optical trapping and manipulation of micrometre-sized particles was first reported in 1970. Since then, it has been successfully implemented in two size ranges: the subnanometre scale, where light-matter mechanical coupling enables cooling of atoms, ions and molecules, and the micrometre scale, where the momentum transfer resulting from light scattering allows manipulation of microscopic objects such as cells. But it has been difficult to apply these techniques to the intermediate - nanoscale - range that includes structures such as quantum dots, nanowires, nanotubes, graphene and two-dimensional crystals, all of crucial importance for nanomaterials-based applications. Recently, however, several new approaches have been developed and demonstrated for trapping plasmonic nanoparticles, semiconductor nanowires and carbon nanostructures. Here we review the state-of-the-art in optical trapping at the nanoscale, with an emphasis on some of the most promising advances, such as controlled manipulation and assembly of individual and multiple nanostructures, force measurement with femtonewton resolution, and biosensors.