Nonadiabatic approach to entanglement distribution over long distances