"Two playoff teams, back to back, and we came back out here tonight and did it again," running back Frank Gore said. "We came out here and started the game fast, and then we finished it."

This stingy, opportunistic defense denied Stafford another milestone and again is making its mark as one of the league's elite facing the top offenses and most prolific passers.

Smith completed 20 of 31 throws for 226 yards and extended his franchise-record streak of passes without an interception to 216. He led the reigning NFC West champion Niners (2-0) to their ninth consecutive victory in the series since the Lions' last victory on Sept. 25, 1995. Smith took a hard hand to the helmet from John Wendling late and bloodied his nose, then found Davis again.

"He's as tough as a two-dollar steak," 49ers coach Jim Harbaugh said. "I grew up eating a lot of them. I know what I'm talking about."

The 49ers ran their home winning streak against the Lions to 12 games since Detroit's last victory at Candlestick Park on Nov. 2, 1975.

And no heated greeting after this one. Harbaugh and Lions coach Jim Schwartz met each other with a friendly hello and handshake during pregame warmups, then an uneventful shake and half-hug when time expired.

"I thought it went good," Harbaugh said.

Gore carried 17 times for 89 yards and a 1-yard touchdown, just missing his second 100-yard game this year and fourth in the series.

Calvin Johnson caught eight passes for 94 yards, but that was hardly enough as the Lions (1-1) didn't get closer than the 20 until their final drive on a cool, windy night by the bay. San Francisco's secondary kept Megatron from catching a touchdown pass for the second successive matchup, forcing Stafford to rely heavily on the running game.

Another impressive outing by a defense that shut down Rodgers in a 30-22 win over the Packers last week at Lambeau Field.

Stafford finished 19 for 32 with 230 yards, one touchdown and an interception, missing a chance to become the first player in NFL history to throw for 350 yards in five consecutive games. Drew Brees of the Saints also did so in four consecutive games last season.

Stafford threw for 355 yards in last week's 27-23 victory against St. Louis at home but also had three interceptions before halftime for the first time -- and said he couldn't do that again for the Lions to win. He never got in sync.

"We didn't do a job enough job in anything," Schwartz said. "Whether it was the run game, the pass game, defense, special teams. We need to play better in all phases. We left a lot of opportunities on the field."

The 49ers dominated on both sides of the ball 11 months to the day after rallying for a 25-19 victory at Ford Field to hand Detroit its first defeat following a 5-0 start. It ended with excitable Harbaugh's firm handshake and backslap that ignited Schwartz -- and they had to be separated leaving the field.

There were some hot tempers Sunday, too. After Davis and Walker drove Cliff Avril to the sideline while blocking on a running play, Avril kicked Walker in the helmet and poked Davis in the eye -- though Walker didn't feel like it was intentional. Lions right tackle Gosder Cherilus and 49ers cornerback Tarell Brown pushed and shoved after a big hit by Patrick Willis on Johnson in the first quarter.

Smith hit Michael Crabtree on the left sideline for a 17-yard gain, then Davis scored on the next play. The Lions were without rookie cornerback Bill Bentley because of a concussion sustained last week and cornerback Chris Houston with an ankle injury.

David Akers kicked field goals from 36 and 48 yards for San Francisco a week after connecting from 63 yards to tie an NFL record.

Jason Hanson finished with field goals of 38, 41, 40 and 48 yards. He also missed one off the right upright on a 40-yard attempt late in the second quarter. The Lions scored their lone touchdown on Stafford's 9-yard TD pass to Brandon Pettigrew with 1:29 remaining.

"I don't think as an offense we've hit our stride yet," Stafford said. "We moved the ball really well at times today against a really good defense, and we didn't take advantage of our opportunities in the red zone like we need to."

The 49ers ended their streak of 26 quarters (spanning six regular-season games) without a turnover, and 36 consecutive quarters without a lost fumble since Davis lost one Nov. 6 last year at Washington. San Francisco was trying to match the 2010 Patriots for the NFL record of seven games without a turnover.

After Hanson's first field goal, Kendall Hunter fumbled the kickoff return after being stripped by Tahir Whitehead and Kassim Osgood recovered. It marked the first career lost fumble in 18 games for the second-year halfback.

But Ahmad Brooks batted down a pass on third down in the ensuing series as the Lions had to settle for another field goal.

San Francisco's defense delivered again on Detroit's next series. On third-and-6 from the 20, Stafford threw down the middle of the field with nobody even close and safety Dashon Goldson jumped in for an interception.