ST. LOUIS — Michael Crabtree caught two touchdown passes, one from kicker David Akers on a perfectly executed trick play, helping the San Francisco 49ers withstand a late rally by the St. Louis Rams and wrap up the No. 2 playoff seed in the NFC and a first-round bye in a 34-27 victory Sunday.

Crabtree and Vernon Davis had big days for a team short of pass catchers and Tarell Brown had a pair of interceptions that led to touchdowns as the 49ers (13-3) beat the Rams (2-14) for the second time the last five games.

The 49ers held St. Louis to just 157 total yards in a 26-0 victory that clinched the NFC West in Week 12 but were hanging on at the finish of the rematch after the Rams scored two touchdowns in just 13 seconds late in the fourth quarter to cut the deficit to seven points.