DENVER, AUG. 20 -- Defensive lineman Dennis Brown returned an interception 23 yards to set up Mike Cofer's field goal with 14 seconds left, climaxing a 20-point comeback and giving the San Francisco 49ers a 27-24 preseason victory over the Denver Broncos in a rematch of Super Bowl teams.

The 49ers, who trailed by 24-7 in the second half after John Elway threw two touchdown passes and ran for one, rallied behind backup quarterback Steve Young.

Denver (2-1) had an apparently comfortable lead as it sought to erase part of the stigma from a 55-10 Super Bowl blowout loss to the 49ers in January.

Young, replacing Joe Montana late in the first half, had two second-half touchdown passes, including a four-yard flip to tight end Jamie Williams with 40 seconds left, tying the score at 24.

Two plays later Denver's Gary Kubiak threw a short pass to fullback Melvin Bratton, who bobbled the ball and knocked it into the air with his knee -- right into Brown's hands.

The 290-pound lineman rumbled to the 4-yard line, where he was tripped up by Kubiak with 17 seconds left. Cofer kicked a 22-yard field goal on the next play.

Elway completed 14 of 17 passes for 177 yards. Having what coach Dan Reeves has called his best preseason, Elway has completed 26 of 32 passes for 295 yards.

After running for a two-yard touchdown following a 49ers turnover, Elway capped an 80-yard drive with a 13-yard pass to Vance Johnson for a 14-0 first-quarter lead. He completed five of six passes on that drive.

Kubiak replaced Elway for one series in the second quarter, but Elway returned with 1:26 left in the half and directed a hurry-up offense that produced a field goal and a 17-7 halftime lead.

Elway then took Denver 77 yards on the opening possession of the second half before retiring for the night. He completed all four of his passes for 72 yards on that drive, including a scrambling 14-yard touchdown to rookie Shannon Sharpe.

Montana led San Francisco on an 18-play, 79-yard scoring drive early in the second quarter, with Montana getting the score on a one-yard dive.