Functionalization of atomically thin nanomaterials enables the tailoring of their chemical, optical and electronic properties. Exfoliated black phosphorus (BP)—a layered two-dimensional semiconductor—exhibits favourable charge-carrier mobility, tunable bandgap and highly anisotropic properties, but it is chemically reactive and degrades rapidly in ambient conditions. Here we show...