DENVER -- David Akers kicked four of his five field goals in the second half and the San Francisco 49ers withstood Peyton Manning's first two touchdown passes since joining the Denver Broncos for a 29-24 exhibition victory on Sunday.
Alex Smith played most of the first half for the 49ers and had a touchdown pass to his fleet tight end Vernon Davis in a solid effort. Smith was 5-of-7 for 68 yards and had a fumble on a bad snap exchange.
Manning, who joined the Broncos as a free agent after 14 illustrious seasons with Indianapolis, completed 10 of 12 passes for 122 yards in his most effective outing since coming back from a neck injury that sidelined him during his final season with the Colts.
Trailing by 14, the 49ers' reserves put together a run of 16 straight points, including Akers' fourth field goal, a 32-yarder with 9:22 left to play, that put the 49ers in front by two points, their first lead of the day.
Akers had one more field goal, a 44-yarder, with 3:01 to play.
There was some confusion before Akers kicked the go-ahead field goal among the group of replacement officials.
Broncos coach John Fox sought to challenge a ruling that 49ers quarterback Scott Tolzien lost the ball at the end of a scramble after hitting the ground, negating an apparent fumble. It was determined that the ruling was not subject to challenge and initially the officials flagged Fox for unsportsmanlike conduct for trying to lodge the challenge. After some discussion, the officials picked up the flag, however.
The 49ers, who were held to 14 yards rushing on nine attempts in the first half, got a boost from their running game in the second half and also were helped by a penalty on the Broncos.
Rookie Omar Bolden was flagged for interfering with receiver Brett Swain, giving the 49ers a 31-yard advance to the Broncos' 35-yard line.
On 3rd-and-1, fullback Anthony Dixon broke through the line and into the clear for a 26-yard touchdown, pulling the 49ers to within 24-17 with 12:51 remaining in the third quarter. Dixon finished with 58 of the 49ers' 140 yards rushing, 126 of which came in the second half.
Manning led three first-quarter scoring drives before leaving, and the Broncos went on to take a 24-10 halftime lead when Caleb Hanie hooked up with tight end Joel Dreesen for a 5-yard touchdown pass on one of the final plays of the second quarter.
Matt Prater ended the Broncos' opening possession with a 53-yard field goal.
Over the next two series, both ending in touchdowns, Manning completed eight consecutive passes, the longest a 38-yard completion to running back Lance Ball in which the quarterback shook off a hit from linebacker Parys Haralson.
Two plays later, Manning connected on the first of his scoring passes, hitting Eric Decker from 10 yards out after the Broncos wide receiver got a step on cornerback Carlos Rogers.
The Broncos turned a fumbled snap by Smith, which was recovered by linebacker Wesley Woodyard at the 49ers' 24-yard line, into another score when Decker caught a 5-yard touchdown pass from Manning.
Up 17-0, the Broncos tried a surprise onside kick but were flagged for illegal touching when Matthew Willis grabbed the ball before it traveled 10 yards, giving San Francisco possession at Denver's 44-yard line. On the next play, Smith threw a strike to Davis, who ran by linebacker Von Miller, for a touchdown. Perrish Cox, a former Bronco trying to win a roster spot with the 49ers, intercepted a Hanie pass to set up a 33-yard field goal by Akers. Hanie and his intended target, Decker, appeared to have a miscommunication on the route, allowing Cox to step up uncontested for the ball when Decker broke deep.
NOTES: Broncos running back Lance Ball left the game late in the first quarter with a chest injury and did not return. ... San Francisco running backs LaMichael James (left ankle) and Brandon Jacobs (left knee) sat the game out with injuries. ... Randy Moss made his first start as a 49er but did not have a catch.