Alex Smith hit Vernon Davis with a 14-yard touchdown with nine seconds left as San Francisco shocked New Orleans 36-32 in the NFC Divisional playoffs Saturday at Candiestick Park in San Francisco.

Davis' second touchdown of the day answered Jimmy Graham's 66-yard touchdown from Drew Brees with 1:48 left, giving the Saints a 32-29 lead.

There were four lead changes in the fourth quarter after the Saints rallied back from an early 17-0 deficit that could be largely blamed on five Saints turnovers.

Smith completed 24 of 42 passes for 299 yards and three touchdowns. He ran for another score. Davis caught seven passes for 180 yards and a score.

That was enough to outduel Drew Brees, who passed for 458 yards, four touchdowns, but also two early interceptions. Brees completed 39 of 62 passes.

Smith's 28-yard touchdown run, the longest of his career, came after he threw a 35-yard pass to Vernon Davis, who earlier had a 49-yard touchdown pass from Smith.

Graham's touchdown came after Smith had given the 49ers the lead with a 28-yard touchdown run. Before that, New Orleans had taken a 24-23 lead, its first of the game, when Brees found Darren Sproles for a 44-yard touchdown out of the backfield

New Orleans turned the ball over times in the first half, leading to a a 17-0 lead for the 49ers.

A 49-yard touchdown from Smith to Davis got the 49ers on the scoreboard, then a short pass from Smith to Crabtree after a Saints fumble upped the lead to 17-0.

But the Saints cut it to 17-14 at halftime after Brees threw touchdown passes of 14 and 25 yards to Jimmy Graham and Marques Colston, respectively.