A measurement of the neutron lifetime τ n performed by the absolute counting of in-beam neutrons and their decay protons has been completed. Protons confined in a quasi-Penning trap were accelerated onto a silicon detector held at a high potential and counted with nearly unit efficiency. The neutrons were counted by a device with an efficiency inversely proportional to neutron velocity, which cancels the dwell time of the neutron beam in the trap. The result is τ n = (886.6 ± 1.2[stat] ± 3.2[sys]) s, which is the most precise measurement of the lifetime using an in-beam method. The systematic uncertainty is dominated by neutron counting, in particular the mass of the deposit and the 6 Li(n,t) cross section. The measurement technique and apparatus, data analysis, and investigation of systematic uncertainties are discussed in detail.