PITTSBURGH (AP) — Albert Pujols hit his 697th home run, moving past Alex Rodriguez into fourth place on the career list and doing it in dramatic fashion with a ninth-inning drive that pushed the St. Louis Cardinals over the Pittsburgh Pirates 4-3 Sunday.

The NL Central-leading Cardinals trailed 2-1 when Pujols connected for a two-run shot. He trails Barry Bonds (762), Hank Aaron (755) and Babe Ruth (714) on the all-time homer chart. The 42-year-old Pujols has 21 games left in his 22nd and final season in the big leagues.

The Cardinals went to the ninth inning trailing 2-0 but scored four runs off Chase DeJong (4-2). Tommy Edman and Corey Dickerson led off with back-to-back doubles to produce the first run. One out after Pujols connected, Tyler O’Neil hit a solo shot to cap St. Louis’ big inning.

Ryan Helsley then got Ben Gamel to fly out for his 16th save. Chris Stratton (8-4) retired both batters he faced.