Six billion years from now, while evolving on the asymptotic giant branch (AGB), the Sun will metamorphose from a red giant into a beautiful planetary nebula. This spectacular evolution will impact the solar system planets, but observational confirmations of the predictions of evolution models are still elusive as no planet orbiting an AGB star has yet been discovered. The nearby AGB red giant L 2 Puppis (d = 64 pc) is surrounded by an almost edge-on circumstellar dust disk. We report new observations with ALMA at very high angular resolution (18 × 15 mas) in band 7 (ν ≈ 350 GHz) that allow us to resolve the velocity profile of the molecular disk. We establish that the gas velocity profile is Keplerian within the central cavity of the dust disk, allowing us to derive the mass of the central star L 2 Pup A, m A = 0.659 ± 0.011 ± 0.041 M (±6.6%). From evolutionary models, we determine that L 2 Pup A had a near-solar main-sequence mass, and is therefore a close analog of the future Sun in 5 to 6 Gyr. The continuum map reveals a secondary source (B) at a radius of 2 AU contributing f B / f A = 1.3 ± 0.1% of the flux of the AGB star. L 2 Pup B is also detected in CO emission lines at a radial velocity of v B = 12.2 ± 1.0 km s −1 . The close coincidence of the center of rotation of the gaseous disk with the position of the continuum emission from the AGB star allows us to constrain the mass of the companion to m B = 12 ± 16 M Jup . L 2 Pup B is most likely a planet or low-mass brown dwarf with an orbital period of about five years. Its continuum brightness and molecular emission suggest that it may be surrounded by an extended molecular atmosphere or an accretion disk. L 2 Pup therefore emerges as a promising vantage point on the distant future of our solar system.