Single-photon sources based on semiconductor quantum dots offer distinct advantages for quantum information, including a scalable solid-state platform, ultrabrightness and interconnectivity with matter qubits. A key prerequisite for their use in optical quantum computing and solid-state networks is a high level of efficiency and indistinguishability. Pulsed resonance fluorescence has been anticipated as the optimum condition for the deterministic generation of high-quality photons with vanishing effects of dephasing. Here, we generate pulsed single photons on demand from a single, microcavity-embedded quantum dot under s-shell excitation with 3 ps laser pulses. The π pulse-excited resonance-fluorescence photons have less than 0.3% background contribution and a vanishing two-photon emission probability. Non-postselective Hong-Ou-Mandel interference between two successively emitted photons is observed with a visibility of 0.97(2), comparable to trapped atoms and ions. Two single photons are further used to implement a high-fidelity quantum controlled-NOT gate.