CHICAGO -- Catcher John Baker pitched a scoreless top of the 16th inning, and he scored the winning run in the bottom half on a sacrifice fly as the Chicago Cubs beat the Colorado Rockies 4-3 in a game that started Tuesday night and ended Wednesday morning.

The Cubs loaded the bases in the bottom of the 16th against Rockies left-hander Tyler Matzek (2-5) and finally ended a marathon game on a fly to right by shortstop Starlin Castro.

The game, which lasted 6 hours, 27 minutes, set club records for time for each team. The previous Cubs record was 6 hours, 10 minutes against the Los Angeles Dodgers on Aug. 17-18, 1982. The previous record for the Rockies was 6 hours, 16 minutes on April 17, 2008, against the San Diego Padres.

Baker (1-0) made the first pitching appearance of a pro career that began in 2002. He got the first batter to foul out. After issuing a walk, Baker induced a double-play grounder from Colorado shortstop Cristhian Adames, who was making his major league debut.