Updated

Troy Smith needed three quarters to find his range in his first start as a 49er. Once he did, San Francisco rallied to victory in the NFL's fourth regular-season game in London.

Smith completed three long passes in the fourth quarter to lead the 49ers to a 24-16 win over the Denver Broncos on Sunday.

Trailing 10-3 and struggling all day, Smith tied the score by rushing for a 1-yard touchdown after completing back-to-back passes to Delanie Walker, the first for 27 yards and the second for 38 following a scramble.

Less than 5 minutes later, Smith threw a 28-yard touchdown pass to Michael Crabtree with 7:23 left to put San Francisco (2-6) ahead 17-10. Frank Gore scored another TD with 3:47 to go, running in from the 3.

Smith, the 2006 Heisman Trophy winner from Ohio State, found out only a few days ago that he was going to start at Wembley because Alex Smith was diagnosed with a separated shoulder. And he struggled in the first half, completing 4 of 9 passes for 37 yards.

He finished with 196 yards on 12-of-19 passing.

Gore helped out with a productive day on the ground, rushing for 118 yards on 29 carries.

The Broncos (2-6) got their first touchdown in the third quarter when Tim Tebow ran in from a yard after Kyle Orton connected with Brandon Lloyd for 71 yards.

Orton pulled the Broncos within a score with 2:19 to go in the game, hitting Lloyd for a 1-yard touchdown. But Matt Prater shanked the extra point attempt.

Orton completed 28 of 40 passes for 369 yards. But he also made the only two turnovers of the game. Manny Lawson swatted the ball out of his hand in the fourth quarter, setting up Gore's TD run. Then he threw an interception to Shawntae Spencer as time was winding down.

Lawson also drilled Orton in the third quarter, knocking him to the ground on a third-down pass attempt. Orton was back in for the next possession.

Although it rained in London for much of the day, it was dry during the game at Wembley Stadium — the home of England's national soccer team and venue for the 1966 World Cup final.

As the home team, the 49ers were able to distribute flags to the 83,941 fans. While spectators were dressed in a myriad of NFL colors, the majority were cheering for San Francisco.

This is the fourth straight year the NFL has played a regular-season game in London. And with another packed Wembley assured in the buildup, NFL Commissioner Roger Goodell was still talking about more games in Britain and possibly a franchise based in London in the future.

The fans were struggling for something to cheer for in the first half, with the exception of the lone scoring drive from the Niners.

San Francisco took the ball 65 yards on 13 plays and led 3-0 when Joe Nedney kicked a 34-yard field goal with 27 seconds to go in the first quarter.

The Broncos took the lead on Tebow's run, then went ahead 10-3 early in the fourth quarter when Prater made a 32-yard field goal.

The Broncos twice had touchdown plays called back. The second would have put them in position to try to tie the game with a 2-point conversion, but an illegal block nullified Eddie Royal's 78-yard punt return.

In the third quarter, Orton connected with Lloyd for 25 yards, and on the next play, Orton handed off to Knowshon Moreno, who pitched back to Orton for a 38-yard touchdown pass to Jabar Gaffney. But it was called back for a chop block penalty by Moreno.

Lloyd finished with 169 yards on seven receptions.