Recent developments of quantum information science [1] critically rely on entanglement, an intriguing aspect of quantum mechanics where parts of a composite system can exhibit correlations stronger than any classical counterpart [2]. In particular, scalable quantum networks require capabilities to create, store, and distribute entanglement among distant matter nodes via photonic channels [3]. Atomic ensembles can play the role of such nodes [4]. So far, in the photon counting regime, heralded entanglement between atomic ensembles has been successfully demonstrated via probabilistic protocols [5,6]. However, an inherent drawback of this approach is the compromise between the amount of entanglement and its preparation probability, leading intrinsically to low count rate 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-photon [7,8,9] and subsequent state transfer, we separate the generation of entanglement and its storage [10]. After a programmable delay, the stored entanglement is mapped back into photonic modes with overall efficiency of 17%. Improvements of single-photon sources [11] together with our protocol will enable "on-demand" entanglement of atomic ensembles, a powerful resource for quantum networking.In the quest to achieve quantum networks over long distances [3], an area of considerable activity has been the interaction of light with atomic ensembles comprised of a large collection of identical atoms [4,12,13]. In the regime of continuous variables, a particularly notable advance has been the teleportation of quantum states between light and matter [14]. For discrete variables with photons taken one by one, important achievements include the efficient mapping of collective atomic excitations to single photons [15,16,17,18,19], the realization of entanglement between a pair of distant ensembles [5,20] In all these cases, progress has relied upon probabilistic schemes following the measurement-induced approach developed in the seminal paper by Duan, Lukin, Cirac and Zoller [4] (DLCZ ) and subsequent extensions. For the DLCZ protocol, heralded entanglement is generated by detecting a single photon emitted indistinguishably by one of two ensembles. Intrinsically, the probability p to prepare entanglement with only 1 excitation shared between two ensembles is related to the quality of entanglement, since the likelihood for contamination of the entangled state by processes involving 2 excitations scales as p [20], and results in low success probability for each trial. Although the degree of stored entanglement can approach unity for the (rare) successful trials [20], the condition p ≪ 1 dictates reductions in count rate and compromises in the quality of the resulting entangled state (e.g., as p → 0, processes such as stray light scattering and detector dark counts become increasingly important). Furthermore, for finite memory time, subsequent connection of entanglement become...