We present a 0.16% precise and 0.27% accurate determination of R0, the distance to the Galactic center. Our measurement uses the star S2 on its 16-year orbit around the massive black hole Sgr A* that we followed astrometrically and spectroscopically for 27 years. Since 2017, we added near-infrared interferometry with the VLTI beam combiner GRAVITY, yielding a direct measurement of the separation vector between S2 and Sgr A* with an accuracy as good as 20 μas in the best cases. S2 passed the pericenter of its highly eccentric orbit in May 2018, and we followed the passage with dense sampling throughout the year. Together with our spectroscopy, in the best cases with an error of 7 km s-1, this yields a geometric distance estimate of R0 = 8178 ± 13stat. ± 22sys. pc. This work updates our previous publication, in which we reported the first detection of the gravitational redshift in the S2 data. The redshift term is now detected with a significance level of 20σ with fredshift = 1.04 ± 0.05.GRAVITY has been developed by a collaboration of the Max Planck Institute for Extraterrestrial Physics, LESIA of Paris Observatory/CNRS/UPMC/Univ. Paris Diderot and IPAG of Université Grenoble Alpes/CNRS, the Max Planck Institute for Astronomy, the University of Cologne, the Centro de Astrofísica e Gravitaçâo, and the European Southern Observatory.