On June 13, 2012, in a 10–0 victory, Cain threw the 22nd perfect game in MLB history, against the Houston Astros, striking-out a career-high 14 batters (tying Sandy Koufax for the most strikeouts in a perfect game). It was the first perfect game for the Giants franchise (first in San Francisco), the ninth in NL history, the fifth no-hitter thrown by MLB pitchers in 2012, and the second perfect game of the season after Chicago White Sox pitcher Philip Humber threw one on April 21. Cain threw 125 pitches, the most by a pitcher in a perfect game, and received the most run support ever for a pitcher throwing a perfect game. Cain also singled against Rhiner Cruz and scored in the fifth inning. San Francisco Mayor Ed Lee, in recognition of the perfect game, presented Cain with the key to the city and made a proclamation that June 13 every year will be known as "Matt Cain Day". In addition, Cain set a franchise record for a single-game score at 101 and is currently the first and only Giants pitcher to break the 100 barrier.