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 L2 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 x 15 mas) in band 7 (f ~ 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 L2 Pup A, mA = 0.659 +/- 0.011 +/- 0.041 Msun (+/- 6.6%). From evolutionary models, we determine that L2 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 the presence of a secondary source (B) at a radius of 2 AU contributing fB/ fA = 1.3 +/- 0.1% of the flux of the AGB star. L2 Pup B is also detected in CO emission lines at a radial velocity of vB = 12.2 +/- 1.0 km/s. 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 mB = 12 +/- 16 MJup. L2 Pup B is most likely a planet or low mass brown dwarf with an orbital period around 5 years. Its continuum brightness and molecular emission suggest that it may be surrounded by an extended molecular atmosphere or an accretion disk. L2 Pup therefore emerges as a promising vantage point on the distant future of our Solar System.