Alex Smith led the Chiefs to a pair of scoring drives against his former team, but B.J. Daniels hit fellow rookie Chuck Jacobs with the go-ahead touchdown pass with 2:02 left in the game, to boost the San Francisco 49ers to a 15-13 preseason win over Kansas City.
Quintin Demps returned a kickoff 104 yards for a TD in the first quarter for the Chiefs, who got field goals of 47 and 23 yards from Ryan Succop in the first half.
Smith, who spent the previous eight seasons with San Francisco after being taken with the No. 1 overall pick out of Utah in 2005, was traded to the Chiefs after the 2012 season. He completed 7-of-16 passes for 62 yards in playing the entire first half.
Chase Daniel completed all six of his passes for 51 yards for the Chiefs.
Colin Kaepernick, who took over as the starter for Smith last season, threw just two passes in this game. Daniels completed 6-of-9 throws for 72 yards. Colt McCoy and Scott Tolzien also saw extensive playing time at QB.
After Phil Dawson's 42-yard field goal early in the first, Demps raced the other way to give KC a 7-3 lead.
Dawson converted a 55-yard kick early in the second and added another from the same distance in the third.
The Chiefs were without running back Jamaal Charles, who suffered a strained right foot in practice earlier this week.