Updated

At the time Anthony Dixon scored on a one- yard run with 6:30 left in fourth quarter, the touchdown seemed like the final touch on a victory that would secure the NFC's No. 2 seed for the 49ers.

San Francisco still locked up that seed and a first-round bye, but just barely.

Needing only a victory over St. Louis to guarantee the bye, the 49ers held off a late-game rally by the Rams to earn a 34-27 victory.

Thanks to an onside kick recovery, St. Louis scored two touchdowns after Dixon's score made it a 34-13 game, and was in position to tie the game. After forcing the 49ers to punt, the Rams held the ball near midfield with just under four minutes to play.

But backup quarterback Kellen Clemens suffered a right ankle injury after leading St. Louis into San Francisco territory, the Rams turned the ball over on downs with Tom Brandstater under center, and the Niners held on for the crucial win.