SAN FRANCISCO — The 49ers offense took a few more steps forward Sunday, with the passing attack showing promise for one of the few times this season. The hard-charging defense hit its stride long ago and shows no sign of slowing down.
"This is the time of the year where you have to be playing pretty good defense," 49ers defensive lineman Justin Smith said. "We are starting to step it up a little bit there and playing good defensive ball when we need to."
Starting to? The 49ers held the St. Louis Rams without a touchdown until the waning seconds Sunday in a 23-13 victory and allowed an average of 12.6 points their past nine games.
The Rams touchdown came with 18 seconds left and the 49ers far more interested in running out the clock than preventing a meaningless touchdown.
The Rams touchdown marked the first allowed by the 49ers since New Orleans Saints fullback Jed Collins scored with 1 minute, 58 seconds left in the first half in a game played Nov. 17.
For those counting, that's one touchdown allowed in more than 10 quarters. Suffice, the 49ers defense is tough enough to get the job done in December and beyond.
Coach Jim Harbaugh said Friday that only the "tough" flourish once December rolls around because of the physical and mental grind from offseason workouts, training camp and the first three months of the regular season.
Defensive tackle Glenn Dorsey said he and his linemates are up for the challenge, and they don't need a calendar to know where they are in the season.
"You want to play tour best ball toward the end," Dorsey said. "Everyone recognizes that the time is now for us to stand up and play like we're supposed to play. Everybody realizes that, and we're doing a good job."
The 49ers held the Rams to 73 yards offense in the first half and 117 through three quarters. The bulk of the Rams 312 yards came with the 49ers in firm control of the game.
Defensive lineman Ray McDonald returned to action Sunday after he missed two games with an ankle injury. He notched one of the 49ers three sacks and said the defense hasn't peaked just yet.
"They say December and January is when you play championship football," McDonald said. "Hopefully we're just hitting our stride and we're going to keep getting better and better every week."
The Saints are the only team to score more than 20 points against the 49ers since the 49ers allowed 28, 29 and 27 points their first three games, respectively.
The 49ers overall are second in the league in terms of average points allowed at 16. Coincidentally, that's where they finished each of the past two seasons, when they allowed 17.1 per game last season and 14.3 in 2011.
Linebacker Patrick Willis said he is focused on this year's defense and not into providing context.
"It's all about selling out, giving everything I have," Willis said, "so that I don't look back and say, 'I wish I would have gave more.' That's the mindset of our team and that's what we're going with."