The sixth-seeded Williams served for the match at 40-0 but Ahn saved three match points. An ace gave her a fourth opportunity to win but she hit a shot into the net.
Tsitsipas had three match points on Caruso’s serve at 5-2 but could not convert any of them. He finally secured victory on his own serve with an ace down the middle of the court after an hour and 45 minutes.
The 33-year-old looked beaten as 23-year-old debutant Medvedev broke serve twice in the decider to stand on the brink of a first career victory over the Spaniard he pushed to five sets in an epic U.S. Open final in September.
The top seed will be playing for his 10th title at his home tournament when he faces Alex de Minaur in a first-time meeting after the Australian stopped Reilly Opelka 7-6 (7/2), 6-7 (4/7), 7-6 (7/3).
The 20-year-old, who trains and lives in Spain, will target his fourth title of 2019 on Sunday when he faces either nine-time champion Roger Federer or third seed Stefanos Tsitsipas.