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 straight win 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.
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. Coaches Jim Harbaugh and Jim Schwartz met each other with a friendly hello and handshake during pregame warmups, then an uneventful shake and half-hug when time expired.
Frank Gore carried 17 times for 89 yards and a 1-yard touchdown, just missing his fifth 100-yard game in as many career meetings with the Lions.
Calvin Johnson caught eight passes for 94 yards, but that was hardly enough as the Lions (1-1) never got 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 straight 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 straight 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 win over 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.
The 49ers dominated on both sides of the ball 11 months to the day after rallying for a 25-19 win 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 Lions coach Schwartz and they had to be separated leaving the field.
There were some hot tempers Sunday, too. After Davis and Delanie Walker drove Cliff Avril to the sideline while blocking on a running play, Avril kicked Walker in the helmet. 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 exploited Detroit's depleted, frustrated secondary at every opportunity. On his TD, Davis easily beat Wendling, starting as regular safety Louis Delmas recovers from knee surgery.
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.
The 49ers ended their streak of 26 quarters spanning six straight 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.
A special teams blunder hurt the Lions late in the first quarter when Drayton Florence, another fill-in cornerback, was flagged for running into Akers. That gave the Niners first down at the 12, and Gore scored three plays later 3 seconds into the second quarter.
San Francisco's defense kept Detroit out of the end zone on the Lions' first drive despite a big penalty. Chris Culliver received a debated pass interference from the replacement officials when he tipped a pass intended for Titus Young for a 33-yard penalty.
Online: http://pro32.ap.org/poll and http://twitter.com/APNFL
Detroit 6 0 3 10 19
San Francisco 7 7 3 10 27
SF • V.Davis 21 pass from Ale.Smith (Akers kick), 12:25.
Det • FG Hanson 38, 7:47.
Det • FG Hanson 41, 6:43.
SF • Gore 1 run (Akers kick), 14:57.
SF • FG Akers 36, 9:42.
Det • FG Hanson 40, 3:40.
SF • FG Akers 48, 14:42.
Det • FG Hanson 48, 9:16.
SF • V.Davis 23 pass from Ale.Smith (Akers kick), 3:04.
Det • Pettigrew 9 pass from Stafford (Hanson kick), 1:29.
Attendance • 69,732.
First downs 15 24
Total Net Yards 296 349
Rushes-yards 26-82 27-148
Passing 214 201
Punt Returns 1-10 1-8
Kickoff Returns 2-64 5-85
Interceptions Ret. 0-0 1-20
Comp-Att-Int 19-32-1 20-31-0
Sacked-Yards Lost 2-16 3-25
Punts 2-44.5 3-36.3
Fumbles-Lost 0-0 2-1
Penalties-yards 8-67 5-62
Time of Possession 30:26 29:34
Rushing • Detroit, Smith 16-53, Bell 6-14, Stafford 2-10, Burleson 2-5. San Francisco, Gore 17-89, Manningham 1-29, Hunter 5-23, Ale.Smith 4-7.
Passing • Detroit, Stafford 19-32-1-230. San Francisco, Ale.Smith 20-31-0-226.
Receiving • Detroit, Johnson 8-94, Pettigrew 3-18, Bell 2-59, Smith 2-17, Scheffler 1-13, Burleson 1-11, T.Young 1-11, Heller 1-7. San Francisco, Crabtree 6-67, V.Davis 5-73, Manningham 3-28, Hunter 2-21, Gore 2-16, Moss 1-14, Walker 1-7.
Missed Field Goals • Detroit, Hanson 40 (WR).