Ultracold atoms trapped by light offer robust quantum coherence and controllability, providing an attractive system for quantum information processing and for the simulation of complex problems in condensed matter physics. Many quantum information processing schemes require the manipulation and deterministic entanglement of individual qubits; this would typically be accomplished using controlled, state-dependent, coherent interactions among qubits. Recent experiments have made progress towards this goal by demonstrating entanglement among an ensemble of atoms1 confined in an optical lattice. Until now, however, there has been no demonstration of a key operation: controlled entanglement between atoms in isolated pairs. Here we use an optical lattice of double-well potentials2, 3 to isolate and manipulate arrays of paired 87Rb atoms, inducing controlled entangling interactions within each pair. Our experiment realizes proposals to use controlled exchange coupling4 in a system of neutral atoms5. Although 87Rb atoms have nearly state-independent interactions, when we force two atoms into the same physical location, the wavefunction exchange symmetry of these identical bosons leads to state-dependent dynamics. We observe repeated interchange of spin between atoms occupying different vibrational levels, with a coherence time of more than ten milliseconds. This observation demonstrates the essential component of a neutral atom quantum SWAP gate (which interchanges the state of two qubits). Its 'half-implementation', the gate, is entangling, and together with single-qubit rotations it forms a set of universal gates for quantum computation4.