Light elements were produced in the first few minutes of the Universe through a sequence of nuclear reactions known as Big Bang nucleosynthesis (BBN)1,2. Among the light elements produced during BBN1,2, deuterium is an excellent indicator of cosmological parameters because its abundance is highly sensitive to the primordial baryon density and also depends on the number of neutrino species permeating the early Universe. Although astronomical observations of primordial deuterium abundance have reached percent accuracy3, theoretical predictions4-6 based on BBN are hampered by large uncertainties on the cross-section of the deuterium burning D(p,γ)3He reaction. Here we show that our improved cross-sections of this reaction lead to BBN estimates of the baryon density at the 1.6 percent level, in excellent agreement with a recent analysis of the cosmic microwave background7. Improved cross-section data were obtained by exploiting the negligible cosmic-ray background deep underground at the Laboratory for Underground Nuclear Astrophysics (LUNA) of the Laboratori Nazionali del Gran Sasso (Italy)8,9. We bombarded a high-purity deuterium gas target10 with an intense proton beam from the LUNA 400-kilovolt accelerator11 and detected the γ-rays from the nuclear reaction under study with a high-purity germanium detector. Our experimental results settle the most uncertain nuclear physics input to BBN calculations and substantially improve the reliability of using primordial abundances to probe the physics of the early Universe.