The interior structure of Saturn, the depth of its winds, and the mass and age of its rings constrain its formation and evolution. In the final phase of the Cassini mission, the spacecraft dived between the planet and its innermost ring, at altitudes of 2600 to 3900 kilometers above the cloud tops. During six of these crossings, a radio link with Earth was monitored to determine the gravitational field of the planet and the mass of its rings. We find that Saturn's gravity deviates from theoretical expectations and requires differential rotation of the atmosphere extending to a depth of at least 9000 kilometers. The total mass of the rings is (1.54 ± 0.49) × 1019 kilograms (0.41 ± 0.13 times that of the moon Mimas), indicating that the rings may have formed 107 to 108 years ago.