Entanglement is an intrinsic property of quantum mechanics and is predicted to be exhibited in the particles produced at the Large Hadron Collider. A measurement of the extent of entanglement in top quark-antiquark (tt¯) events produced in proton-proton collisions at a center-of-mass energy of 13 TeV is performed with the data recorded by the CMS experiment at the CERN LHC in 2016, and corresponding to an integrated luminosity of 36.3 fb-1. The events are selected based on the presence of two leptons with opposite charges and high transverse momentum. An entanglement-sensitive observableDis derived from the top quark spin-dependent parts of thett¯production density matrix and measured in the region of thett¯production threshold. Values ofD<-1/3are evidence of entanglement andDis observed (expected) to be-0.480-0.029+0.026(-0.467-0.029+0.026) at the parton level. With an observed significance of 5.1 standard deviations with respect to the non-entangled hypothesis, this provides observation of quantum mechanical entanglement withintt¯pairs in this phase space. This measurement provides a new probe of quantum mechanics at the highest energies ever produced.