A protocol where entanglement between two atomic ensembles is created by coherent mapping of an entangled state of light, effectively separating the generation of entanglement and its storage, is reported. Developments in quantum information science1 rely critically on entanglement—a fundamental aspect of quantum mechanics that causes parts of a composite system to show correlations stronger than can be explained classically2. In particular, scalable quantum networks require the capability to create, store and distribute entanglement among distant matter nodes by means of photonic channels3. Atomic ensembles can play the role of such nodes4. So far, in the photon-counting regime, heralded entanglement between atomic ensembles has been successfully demonstrated through probabilistic protocols5,6. But an inherent drawback of this approach is the compromise between the amount of entanglement and its preparation probability, leading to intrinsically low count rates for high entanglement. Here we report a protocol where entanglement between two atomic ensembles is created by coherent mapping of an entangled state of light. By splitting a single photon7,8,9 and performing subsequent state transfer, we separate the generation of entanglement and its storage10. After a programmable delay, the stored entanglement is mapped back into photonic modes with overall efficiency of 17%. Together with improvements in single-photon sources11, our protocol will allow ‘on-demand’ entanglement of atomic ensembles, a powerful resource for quantum information science.