It took Jeff Garcia's runs and throws and one catch after another by Terrell Owens and some key defensive stops and, near the end, a 13-yard touchdown catch by Tai Streets with precisely 1 minute on the clock.
And then, after all of that, it almost didn't matter. After all of that, the embers of the New York Giants' season had not quite been extinguished. It took an errant snap by a backup snapper on a desperation 41-yard field-goal attempt with 9 seconds left to finally snuff out the Giants.
And once that had happened, the 49ers had themselves a breathtaking 39-38 wild-card playoff victory over the Giants before 66,318 at Candlestick Park. The stunning victory sends the 49ers off to play another day, Sunday in Florida against Jon Gruden's Tampa Bay Buccaneers.
``Wow,'' 49ers coach Steve Mariucci said when it came time to address reporters. ``It was a great win for our team, a great come-from-behind win, one of those classics we'll remember for a long time. I don't know where to start. I'm proud to be their coach, because, boy, they gave their hearts.''
Predictably, Giants coach Jim Fassel was as downcast as Mariucci was jubilant.
``This is about the worst loss I have ever felt in my entire life,'' said Fassel, whose team had to win its final four regular-season games simply to make it into the playoffs against the NFC West champion 49ers.
``I am not going to get over this one for a while. I am very proud of our team and the way we played. We should have been able to take it all the way. We worked hard to get here, but in the end the 49ers got us.''
An hour or so earlier, no one in their right mind would have believed it would have been thus - except, perhaps, for a 49ers team that showed cockroach-like survival instincts.
This had seemed as if it would be the Giants' day almost all day, even after Owens' early 76-yard touchdown catch had given the 49ers the game's first points.
From there, the Giants took over, building a 38-14 lead with 4:27 to play in the third quarter.
The 49ers had contributed all day to their apparent demise.
They couldn't stop Giants receiver Amani Toomer, who would catch three touchdown passes and torch 49ers cornerback Ahmed Plummer for eight catches for 136 yards.
They made uncharacteristic mistakes, most glaringly a fumbled punt by Cedrick Wilson at his 8-yard line with the score tied 14-14 late in the first half. Wilson should have let the ball drop untouched, but tried to make a play.
``I had my eyes on the ball,'' he said later, clearly relieved. ``I looked down for a second to see if I had an opportunity to run. I shouldn't have stuck my hands up. It was just a bad decision.''
Then came another bad decision, this one becoming an interception by the Giants' Jason Sehorn on a pass Garcia intended for J.J. Stokes. The Giants marched down the field, with quarterback Kerry Collins hitting Toomer from 24 yards to put the 49ers in a two-touchdown hole at halftime.
At halftime, Owens sought to rouse his gloomy teammates.
``T.O. just inspired all of us today," Plummer said. ``He doesn't get enough credit for that. He got up at halftime and made a speech. He told us the game wasn't over. We still had a chance. Today, he not only talked the talk, he walked the walk."
Owens said, ``I just feel like the last few years, there were times I wanted to say something, but I sat in my locker and thought (Bryant Young) and (Dana Stubblefield) would say something. Today, I just felt I had to be the voice.''
If Owens' words had an effect, it wasn't immediately apparent.
Tiki Barber's 6-yard touchdown run and a 21-yard field goal by Matt Bryant seemed to presage the start of a long off-season for the 49ers, one that surely would have begun with endless speculation about Mariucci's future as their coach.
The 49ers later would thank their fans for sticking with them, but in fact, at 38-14 there was a parade to the exit.
Anyone who left early missed the second-best comeback in 49ers history and the second-best comeback in NFL playoff history.
Only the 49ers' comeback 21 years ago from a 35-7 deficit against New Orleans, and only Buffalo's comeback 10 years ago from a 35-3 deficit to the Houston Oilers were better than what the Niners pulled off Sunday.
Their season on life-support, the 49ers turned to appropriately desperate measures. They went into their 2-minute offense. They went without huddles.
And an offense that hadn't scored more than 23 points in a game in the previous nine scored the 25 points it needed in less than 19 minutes.
On the final four drives, which produced three touchdowns and a 25-yard Jeff Chandler field goal, Garcia connected on 19 of 28 passes for 207 yards and two touchdowns. His rating during that time was 113.2. Until the desperate close, he had completed only 8 of 16 for 124 yards, one touchdown and one interception, a rating of 70.8.
``I think by doing the 2-minute offense, we started to give ourselves an opportunity to get into a rhythm, to get into a position to allow our guys to make plays,'' said Garcia, a playoff winner for the first time in his NFL career. ``It was one play after the next of guys stepping up and playing ball.''
On the first of the four closing drives, the 49ers drove 70 yards in seven plays, scoring on a 26-yard pass from Garcia to Owens, then using the same combination for the 2-point conversion.
Next, the 49ers' defense finally stiffened, forcing the Giants into their first three-and-out of the day. And now, the 49ers got two breaks.
The first was a 29-yard punt by the Giants' Matt Allen, with Vinny Sutherland making a fair catch. Sutherland, signed by the 49ers just last week, had taken over for Wilson. The 49ers got another break when the Giants' Dhani Jones ran into Sutherland, drawing a 15-yard penalty for unnecessary roughness.
Thus, the 49ers began this drive at the Giants' 27, and the third play of the drive was Garcia's 14-yard touchdown run, followed by another 2-point pass to Owens. Suddenly, the deficit was 8, and all but five seconds of the fourth quarter remained.
``Momentum,'' Mariucci said later, ``was wearing a red jersey.''
Next up, after another three-and-out by the Giants, was a 15-play, 74-yard drive that resulted in Chandler's field goal, which cut the 49ers' deficit to 38-33.
On their next possession, the Giants finally moved the ball again, but on third-and-2 from the 49ers' 25, Barber was stopped by Tony Parrish and Julian Peterson for only a 1-yard gain.
The Giants' Bryant attempted a 42-yard field goal, but in a play that would foreshadow the ending he booted the ball wide left after a low snap by newly signed Trey Junkin.
Only 3:01 remained when the 49ers took over at their 32, their season at stake.
Here was Garcia, hitting Owens for 7 yards on third-and-6, hitting Eric Johnson for 25 on third-and-3; running for 12 yards to the Giants' 13, misfiring to Stokes, then hitting Streets to put the 49ers ahead. Seeing he was covered on a post route, Streets adjusted, and Garcia reacted.
``Jeff saw me pull up, and he threw it perfect,'' Streets said.
This 2-point conversion attempt failed, with Will Allen intercepting a pass to Owens. Allen ran the ball out of bounds, and was knocked down by Owens. The Giants' Shaun Williams knocked down Owens. Both received penalties, and Williams was tossed from the game when he threw a punch at Owens.
``Shaun Williams tried to get into my head the whole game,'' Owens said.
The Giants weren't quite finished. Plummer appeared to intercept one deep pass to Toomer, but the play was ruled an incompletion. Still, the Giants reached the 49ers' 23 and lined up for their last-second bid for salvation.
Junkin's snap was low, and the holder, Matt Allen, picked up the ball and heaved it down the field. Penalty flags flew for ineligible Giants linemen beyond the line of scrimmage, and the game, at last, was over.
``It was hard watching them set up for that last field goal,'' Owens acknowledged. ``But funny things happen in this league.''
On this day, only the 49ers were laughing.