SAN FRANCISCO -- Alex Smith gave himself passing marks for his performance against his hometown team's third-stringers and scrubs. Too bad the San Francisco 49ers have already flunked him back one grade on their depth chart.
Smith passed for 146 yards but also threw two terrible interceptions, and San Diego's Eldra Buckley made a one-armed diving catch on a 2-yard touchdown pass with 29 seconds left in the Chargers' 20-17 exhibition victory over the 49ers on Friday night.
Just four weeks ago, Smith never would have expected to be playing three quarters in the season's most meaningless game. But the former No. 1 overall draft pick officially lost his job last week to J.T. O'Sullivan, the journeyman quarterback who will start for the 49ers (2-2) in next week's home opener against Arizona.
Given Smith's 37.5 passer rating in the first half against the Chargers (3-1), he didn't even look like a sure bet for the backup job until Shaun Hill also struggled in the second half. Smith connected with tight end Billy Bajema on a 22-yard TD pass in the third quarter, but his indecision on the throw earned him an animated greeting from offensive coordinator Mike Martz on the sideline.
"I saw things well tonight, and as far as decision-making goes, it was good," Smith said. "On the throw to Billy, I probably needed to let it go a little more aggressively, and that's what Mike was letting me know."
O'Sullivan was sharper than Smith both in practices and in games, including last week's exhibition at Chicago, in which he clinched the starting job with a perfect passer rating. O'Sullivan and Frank Gore sat out against San Diego along with Isaac Bruce, Patrick Willis, Justin Smith and Nate Clements -- but the 49ers still got into injury trouble on the Chargers' game-winning drive when linebacker Parys Haralson sprained his shoulder.
Coach Mike Nolan said he didn't need to see any more from O'Sullivan, despite his inexperience.
"We accomplished our work during the week (of practice)," said Nolan, who also had encouraging words for Smith. "All good quarterbacks throw picks, and they score touchdowns, and the really good ones are a point better than they are bad. Alex has to learn that, and the only way he's going to learn it is by what he did today."
Third-stringer Charlie Whitehurst passed for 144 yards and Malcom Floyd had six catches for 68 yards for the Chargers, whose best players all sat out the club's second exhibition game in five days.
Hobbled linebacker Shawne Merriman was in uniform during warmups, but he joined LaDainian Tomlinson, Philip Rivers, Antonio Gates, Chris Chambers and Jamal Williams on the sideline when the game began. San Diego coach Norv Turner had little reason to do anything significant at Candlestick Park, though he put longtime 49ers linebacker Derek Smith in the starting lineup.
Billy Volek went 6-of-6 for 55 yards on the Chargers' 12-play opening drive, including three passes to fullback Mike Tolbert, who caught a 6-yard TD.
"This was really good for us," Turner said. "We got our young players a lot of experience in some interesting situations. I know it's the last preseason game, but for those guys, they look up there and it's a three-point game, and they're trying to find a way to win. They misplay a ball, and we get a chance to win the game."
The 49ers had the game all but wrapped up when returner Robert Ortiz inexplicably touched a rolling punt at the San Francisco 17 with 2:20 to play, allowing San Diego to recover. Eight plays later, Buckley dived for a remarkable one-handed catch in the end zone -- a good finish for a second-year pro unlikely to make the Chargers' roster after spending last season on the practice squad.
"To make a play at the end to win the game, that's fun for sure," Whitehurst said. "I just tried to put it where only he could get it, and he was able to make a great catch. His eyes were really big."
Haralson forced Whitehurst to fumble on San Diego's second possession, and Smith drove San Francisco to the 6 -- but Jason Hill couldn't snag a potential TD pass, and Smith missed an open receiver on fourth down. Smith then wildly overthrew Arnaz Battle on the next possession, hitting San Diego's Cletis Gordon right between the numbers.
San Francisco's Delanie Walker returned a kickoff 101 yards in the second quarter.