Posey started at catcher during Matt Cain's perfect game on June 13, 2012, the 22nd in major league history. He stated afterwards that the game had him feeling "as nervous as I've ever been on a baseball field." He played in the 2012 Major League Baseball All-Star Game, his first, on July 10, going 0–2 with a walk and a run scored. After batting .289 with 10 home runs and 43 RBI in 77 games before the All-Star break, Posey batted .385 with 14 home runs and 60 RBI in the final 71 games of the season. On July 17, he had three hits and five RBI in a 9–0 victory over the Braves. Four days later, he had four hits and three RBI, including a two-run home run against Cole Hamels in a 10-inning, 6–5 victory over the Phillies. Two days later, he had three hits and four RBI, including a three-run home run against Clayton Richard in a 7–1 victory over the Padres. He hit a game-winning three-run home run against Lance Lynn on August 7 in a 4–2 victory over the St. Louis Cardinals. On September 17, he had three hits, including a game-winning two-run home run against Wade Miley in a 3–2 victory over the Diamondbacks. In 148 games, Posey had 78 runs scored, 178 hits (tied for eighth in the NL with David Wright), 39 doubles (tied for eighth with Yonder Alonso), 24 home runs, and 103 RBI (sixth).