SANTA CLARA, California — A swarm of San Francisco 49ers fans converged on Alex Smith outside the visiting locker room, cheering his name and jostling for position to snap a photo.
Smith left Levi's Stadium to all the glitz and glamor of a respected franchise quarterback. He missed out on what he wanted most: a win.
Smith threw for 175 yards and two touchdowns before an interception ended Kansas City's comeback bid, and the Chiefs lost 22-17 to his former 49ers on Sunday.
"It's tough, you're competitive, you want to win the game. Some of those guys I played a long time with," said Smith, who completed 17 of 31 passes.
Smith was drafted No. 1 overall by San Francisco in 2005 and endured constant changes for most of his tenure. He helped coach Jim Harbaugh turn the 49ers into Super Bowl contenders again and won back many of the same fans that once booed him out of Candlestick Park before Colin Kaepernick took his job for good.
The 49ers smothered Smith and the Chiefs (2-3) after a slow start, including twice in the closing moments. Perrish Cox intercepted Smith's overthrown pass to send Kansas City into the bye with a loss.
"We're a team that's right there. We just have to do a couple of things better," Chiefs coach Andy Reid said.
The 49ers converted a gutsy fake punt from deep in their own territory and leaned on five field goals from Phil Dawson to outfox the Chiefs in the fourth quarter.
San Francisco (3-2) turned to a trick play on fourth-and-1 from its 29, giving a direct snap to Craig Dahl for a 3-yard run up the middle. Kaepernick directed the offense downfield, and Dawson kicked a 27-yard field goal with 8:42 to play for the go-ahead score.
"They got us," Reid said.
Dawson also connected from 55, 52, 35 and 30 yards. He credited Harbaugh and the coaching staff for having confidence in him to make the kicks, particularly the two long ones.
Kaepernick threw for 201 yards and a touchdown, and Frank Gore ran for 107 yards to offset the absence of injured tight end Vernon Davis.
But San Francisco sparked its offense with the fake punt, and more big plays followed. Brandon Lloyd made a leaping 29-yard catch over 6-foot-3 Sean Smith — "basketball's version of the alley-oop," Lloyd said — to extend the drive again and set up Dawson's fourth field goal.
Dawson also lined up for a 54-yard field goal with 4:19 remaining after San Francisco stopped Kansas City. But the Chiefs were penalized for having 12 players on the field, handing the 49ers a first down. Dawson finished the drive with a 30-yard field goal.
Smith and Kansas City took over with 2:12 left and another chance to rally. But Smith sailed a pass to tight end Anthony Fasano, and Cox swooped in for an easy interception.
"If we want to be a really good team, we're going to have to win games like that," Fasano said. "And we will."
On a sun-touched day that sent temperatures into the low-90s in Silicon Valley, both offenses started out hot.
Smith completed six of eight passes for 61 yards on the game's opening drive, capping it with a 2-yard touchdown pass to tight end Travis Kelce. Jamaal Charles ran for 80 yards to eclipse Larry Johnson (6,015 yards) for second place on Kansas City's career rushing list, but was mostly a nonfactor late.
San Francisco scored on all three of its possessions in the first half, though the first two ended with Dawson's big right leg. Kaepernick finished off the third drive where he wanted, rolling to his right and lofting a 9-yard pass to a wide-open Stevie Johnson to give the 49ers a 13-10 lead.
The Chiefs stopped San Francisco to start the third quarter, and De'Anthony Thomas ran his first punt return 28 yards, then caught a short screen and sprinted 17 yards for a score to put the Chiefs back in front, 17-13.
But San Francisco stayed focused and never lost its cool.
NOTES: The often-penalized 49ers finished with just two penalties for 10 yards. ... Charles needs 53 yards to pass Priest Holmes (6,070 yards) for the franchise record. ... 49ers rookie RB Carlos Hyde had 43 yards rushing on 10 carries. ... Dawson once made six field goals in a game, going 6 for 6 on Nov. 28, 2004, with Cleveland.