The 36-year-old Serbian, who is back up to world number one, beat third seed Medvedev 6-3 7-6 (5) 6-3 for a fourth Flushing Meadows crown.
The match hinged on a marathon second set lasting 104 minutes, which was longer than both players’ entire first-round matches.
Having already won in Australia and Paris, Djokovic has picked up three major titles in a year for the fourth time in his career. Only the five-set defeat by Carlos Alcaraz in the Wimbledon final blemished his 2023 record. He said: “I don’t know where to start, it obviously means the world to me. I’m really living my childhood dream to compete at the highest level in a sport that has given me and my family so much.“I never imagined I would be standing here talking about 24 slams. But the last couple of years I felt I had a chance, a shot at history, so why not grab it?”