MINNEAPOLIS (AP) -- The end was as good as the Vikings could have imagined: Brett Favre zipped a pass to a little-used reserve wide receiver in the back of the end zone in the final seconds for a classic Favre finish.
Greg Lewis leaped for a 32-yard touchdown catch with 2 seconds left while a flattened Favre watched from his stomach, and the Vikings stunned the San Francisco 49ers 27-24 on Sunday to stay unbeaten.
In his first real home game with his new team, Favre overcame a bunch of bad throws and a few more hard hits to his almost-40-year-old body and found that winning touch again.
''It's hard to even recall all of 'em. This one was pretty special,'' said Favre, who now has 43 comebacks from fourth-quarter deficits or ties on his career record.
An official review confirmed Lewis's feet were inbounds, sending the sellout crowd into a frenzy.
''I've had some hard losses. This is just another one for the list,'' 49ers cornerback Nate Clements said. ''We just have to keep chopping away.''
The first five series of the second half: Three punts, Favre's first interception, and a turnover on downs. The Vikings (3-0), who gained only 85 yards on Adrian Peterson's 19 carries, still had three timeouts left and were able to force a punt. They got the ball back at their 20 with 89 seconds remaining.
''I didn't say a whole lot,'' Favre said. ''I knew what I was thinking: We blew our chances.''
Well, not quite all of them.
The last play began with 12 seconds left, and Favre stepped forward in the pocket and slid to the right by design to buy time for his receivers to move in position. Instead of throwing a ball up for grabs, he figured
he could get close enough to the line of scrimmage to fire a line drive that would be tougher to defend.
Lewis watched the quarterback's eyes, and broke the other way - Favre said he didn't even know who was running across the end zone - to find room near the right corner.
He caught his first pass from Favre, who completed six throws on that drive, and looked forward to the next one.
''The offensive line was fired up. Adrian was fired up, and the receivers were fired up. And Brett fell right in. He was fired up, too, like: 'We're going to get this done,''' Lewis said. ''And that's the attitude that we took out there on the field.''
That's exactly why the Vikings wanted to sign Favre so badly.
Defensive end Jared Allen was asked what he thought when the offense set up for the final possession.
''Be Brett. One time. Just be Brett,'' Allen said.
Favre finished 24 for 47 for 301 yards and two touchdowns, the most passes he's thrown in a game since Nov. 11, 2007, when he beat the Vikings while with Green Bay by going 33 for 46 for 351 yards and three touchdowns. The Packers, by the way, are up next.
Their defense is surely eager to put some pressure on an old teammate. Favre took plenty of blows from the 49ers (2-1) and listed aches to his right foot, left knee, both shoulders and neck when asked for a report on his health.
He was spry enough, though, to throw a pass from his own end zone and sprint upfield past a zig-zagging Bernard Berrian to put his body into linebacker Patrick Willis for a block at the end of that 36-yard catch-and-run.
Favre was worn out from this, further raising the question about his ability to complete a full season. For now, the Vikings will take his clutch touch.
''He's been in many, many, many, many situations like that,'' coach Brad Childress said, ''so it never hurts you to have a veteran like him going down the field.''
Until the end, Favre was being outplayed by Shaun Hill, a former Minnesota third-stringer who threw two touchdown passes to tight end Vernon Davis. The second was a 20-yard toss over three defenders that gave the Niners a 24-20 lead midway through the fourth quarter.
They sacked Favre twice and applied plenty of pressure. The Hill-to-Davis combination led to seven completions and 96 yards. And they survived the early exit of star running back Frank Gore to an ankle injury by rallying on the road to the verge of victory.
Naturally, the players were devastated, but coach Mike Singletary wouldn't have it.
''You have nothing to be looking at the floor for!'' Singletary yelled, not worried reporters were in the adjacent room. ''You didn't steal anything! You didn't do anything wrong! OK? We're going to get better! We're going to get there! We will see them again in the playoffs, all right? You hold your head up!''
NOTES: Favre's last 300-yard game was on Nov. 22, 2007, a 381-yard performance at Detroit. ... Minnesota's Darius Reynaud was hurt, apparently his left hamstring, while returning a punt in the third quarter. ... Glen Coffee filled in for Gore and had 54 yards on 24 carries. ... The Vikings gave up another special teams TD: Clements picked up a blocked field goal right before the half and returned it 59 yards. Harvin answered in the third quarter with a 101-yard kickoff return for a score.