Reliable state detection plays a central role in quantum-limited metrology and quantum information processing. For example, in quantum computation low error probabilities during detection are required to achieve good efficiency1. In practice, detection fidelity is limited by state perturbations and noise during the measurement process. One way to isolate a quantum system from perturbations is to couple it to an ancillary quantum system used for measurement. The measurement process consists of transferring information from the primary state to the ancilla via a state-dependent interaction, followed by ancilla detection1?5. If detection does not affect the projected states of the primary system, it constitutes a quantum nondemolition (QND) measurement5?9. In this case, the process may be repeated, mitigating the effects of noise and yielding higher fidelity. In addition, the repetitive transfer and measurement of the state provides a natural mechanism for real-time measurement feedback, which can further enhance detection efficiency10,11. Using two trapped ion species (27Al+ and 9Be+), we (1) apply real-time feedback to adaptively minimize the number of detection repetitions, optimizing qubit measurement efficiency, and (2) measure multiple-qubit states with a single ancilla. For a single Al+ qubit measurement, despite 15% error rates for each cycle of ancilla detection, we achieve 99.94% measurement fidelity, limited by the upper state natural lifetime. Error rates, as a function of time, are shown to be exponentially lower with adaptive detection, compared to detection with a fixed number of repetitions. For two-qubit measurements, we demonstrate 98.3% fidelity for distinguishing the number of Al+ ions in one of the qubit levels. These techniques are applied to spectroscopy of an optical clock transition; such techniques could also benefit other experiments in quantum information processing. 1. DiVincenzo, D. P. Scalable Quantum Computers (Wiley-VCH, Berlin, 2001). 2. Haroche, S. & Raimond, J.-M. Exploring the Quantum (Oxford University Press, Oxford, 2006). 3. Schaetz, T. et al. Enhanced quantum state detection efficiency through quantum information processing. Phys. Rev. Lett. 94, 010501 (2005). 4. Schmidt, P. O. et al. Spectroscopy using quantum logic. Science 309, 749?752 (2005). 5. Gleyzes, S. et al. Quantum jumps of light recording the birth and death of a photon in a cavity. Nature 446, 297?300 (2007). 6. Caves, C. M., Thorne, K. S., Drever, R. W., Sandberg, V. D. & Zimmermann, M. On the measurement of a weak classical force coupled to a quantum-mechanical oscillator. I. Issues of principle. Rev. Mod. Phys. 52, 341?392 (1980). 7. Peil, S. & Gabrielse, G. Observing the quantum limit of an electron cyclotron: QND measurements of quantum jumps between Fock states. Phys. Rev. Lett. 83, 1287?1290 (1999). 8. Meunier, T. et al. Nondestructive measurements of electron spins in a quantum dot. Phys. Rev. B 74, 195303 (2006). 9. Lupascu, A. et al. Quantum non-demolition measurement of a superconducting two-level system. Nat. Phys. 3, 119?125 (2007). 10. Armen, M. A., Au, J. K., Stockton, J. K., Doherty, A. C. & Mabuchi, H. Adaptive homodyne measurement of optical phase. Phys. Rev. Lett. 89, 133602 (2002). 11. Cook, R. L., Martin, P. J. & Geremia, J. M. Optical coherent state discrimination using a closed-loop quantum measurement. Nature 446, 774?777 (2007).