SAN FRANCISCO, Jan. 5 (UPI) -- Jeff Garcia brought San Francisco back from a 24-point deficit in the second half Sunday and the 49ers survived a potential game-winning field-goal attempt on the final play to shock the New York Giants, 39-38, and squeak into the divisional round of the NFL playoffs.
During the final 17 minutes, Garcia threw two touchdown passes, ran for another score, converted a pair of two-point conversions and guided the 49ers 74 yards to a field goal.
All of that allowed San Francisco to climb out of a 38-14 hole and set up a trip to Tampa Bay for a game next Sunday. It was the second-largest comeback in playoff history and came after the Pittsburgh Steelers rallied from a 17-point deficit in the second half earlier in the day against the Cleveland Browns.
Garcia's third touchdown pass of the day traveled 13 yards to Tai Streets and gave San Francisco the lead with exactly one minute remaining. A two-point attempt failed, giving New York a chance to win it with a field goal.
The Giants took over after the kickoff at their own 48 and Kerry Collins, who threw four first-half touchdown passes, got New York as far as the San Francisco 23 with six seconds left.
That set up a 41-yard field goal attempt by Matt Bryant. But the snap by the recently obtained Trey Junken was low and holder Matt Allen attempted to save the play by rolling out and throwing the ball downfield.
The pass fell incomplete near the goal line, but it made no difference because the Giants had several linemen downfield, a penalty that would have wiped out a touchdown if one had been scored.
After dominating the first 40 minutes of the game, the Giants were overwhelmed by Garcia and the quick-striking San Francisco attack.
Garcia started the comeback by hitting Terrell Owens with a 26-yard scoring pass with 2:03 to play in the third quarter. Owens had opened the scoring by producing a 76-yard scoring catch on San Francisco's first play of the game.
Owens also caught a two-point conversion from Garcia after his third-quarter touchdown, cutting the deficit to 38-22.
San Francisco's next possession resulted in a 14-yard touchdown run by Garcia and yet another two-point conversion pass to Owens that made it 38-30. The 49ers had to settle for a field goal the next time they had the ball, a 25-yarder by Jeff Chandler with 7:49 to play at the end of a 74-yard drive.
New York then had a chance to put the game away, but on fourth and one at the San Francisco 24, Giants Coach Jim Fassel chose to try a field goal. Junken's snap on that attempt was also poor, resulting in a botched kick. If the Giants had successfully picked up a first down, they would likely have been able to run out the clock.
The 49ers took over with 3:01 remaining at their own 30 for their winning drive and Garcia needed nine plays to produce the touchdown pass to Streets that gave the 49ers the lead.
Garcia completed 27 of 44 passes for 331 yards while Collins wasted a 342-yard effort in which he hit 29 of 43 attempts.
New York overcame the early shock of surrendering the 76-yard touchdown pass from Garcia to Owens and began to pour it on after San Francisco's Cedrick Wilson fumbled a punt at his own eight-yard line in a tie game with three minutes to play in the first half.
In the time remaining in the opening half, the Giants scored two touchdowns and then added another on their opening possession of the third period to seemingely turn the game into a blowout.
Collins tied the game at 7-7 with a 12-yard scoring pass to Amani Toomer with 18 seconds left in the first period at the end of a 65-yard drive, then put the giants in front with a two-yard lob pass to tight end Jeremy Shockey with 12:19 left in the opening half. Shockey set up his own touchdown with a 21-yard catch and run, during which he took a big hit by safety Zack Bronson, bounced off and kept going.
San Francisco briefly tied the game at 14-14 on Kevan Barlow's one-yard run with 6:05 to go in the half, a play that was initially ruled short of the goal line but was changed after a video review.
The 49ers then held the Giants on their next possession, but when Wilson fumbled the punt away at his own eight, San Francisco found itself in an avalanche.
Collins hit Toomer with a touchdown pass on the next play to give the Giants the lead for good and, after stopping the 49ers, they moved 56 yards in five plays over the course of 103 seconds. Toomer caught a 24-yard touchdown pass with 10 seconds left to make it 28-14 at halftime.
San Francisco received the second-half kickoff and soon found itself with a four-and-inches situation at midfield. Coach Steve Mariucci Barber scored on a six-yard run six plays later to make it 35-14 and Matt Bryant added a 21-yard field goal on New York's next possession before the 49ers began their comeback.