The future development of quantum information using superconducting circuits requires Josephson qubits1 with long coherence times combined with a high-fidelity readout. Significant progress in the control of coherence has recently been achieved using circuit quantum electrodynamics architectures(2,3), where the qubit is embedded in a coplanar waveguide resonator, which both provides a well-controlled electromagnetic environment and serves as qubit readout. In particular, a new qubit design, the so-called transmon, yields reproducibly long coherence times(4,5). However, a high-fidelity single-shot readout of the transmon, desirable for running simple quantum algorithms or measuring quantum correlations in multi-qubit experiments, is still lacking. Here, we demonstrate a new transmon circuit where the waveguide resonator is turned into a sample-and-hold detector-more specifically, a Josephson bifurcation amplifier(6,7)-which allows both fast measurement and single-shot discrimination of the qubit states. We report Rabi oscillations with a high visibility of 94%, together with dephasing and relaxation times longer than 0.5 mu s. By carrying out two measurements in series, we also demonstrate that this new readout does not induce extra qubit relaxation.