Quantum computers have the potential to perform certain computational tasks more efficiently than their classical counterparts. The Cirac-Zoller proposal for a scalable quantum computer is based on a string of trapped ions whose electronic states represent the quantum bits of information (or qubits). In this scheme, quantum logical gates involving any subset of ions are realized by coupling the ions through their collective quantized motion. The main experimental step towards realizing the scheme is to implement the controlled-NOT (CNOT) gate operation between two individual ions. The CNOT quantum logical gate corresponds to the XOR gate operation of classical logic that flips the state of a target bit conditioned on the state of a control bit. Here we implement a CNOT quantum gate according to the Cirac-Zoller proposal. In our experiment, two 40Ca+ ions are held in a linear Paul trap and are individually addressed using focused laser beams; the qubits are represented by superpositions of two long-lived electronic states. Our work relies on recently developed precise control of atomic phases and the application of composite pulse sequences adapted from nuclear magnetic resonance techniques.