The Lions got the ball back with about a minute left and comeback master Matthew Stafford gave his team a last-ditch effort to tie the game up.
A drop by Theo Riddick set up a fourth-and-short and Stafford was unable to convert.
The Lions have dropped to 0-2 after putting together a nice comeback, but it was too little, too late.
Have you ever seen a team shoot itself in the foot more? The Lions intercepted a pass and brought it back to the Niners' 5-yard-line, but was negated thanks to a defensive holding call.
The Lions struck back with a touchdown pass to Michael Roberts, cutting the 49ers' lead to three.
Jamal Agnew returned the next Niners' punt for a touchdown, but it was called back because of two block in the back penalties on the Lions.
Matt Stafford finally hit Marvin Jones Jr., connecting for a short touchdown pass to bring the Lions within 10.
On a third-and-17, Matt Stafford hit Golden Tate for a 67-yard pitch and catch, putting the Lions in a first-and-goal situation.
This is just what the offense needed.
Matt Stafford looks like he's hit late by the Niners on the sidelines and LeGarrette Blount comes to his defense, knocking over the San Francisco defender who laid his quarterback out.
Blount received an unsportsmanlike conduct penalty and was booted from the game.
The Lions' defense continues to get gashed by the Niners' run game, leading to a Robbie Gould field goal and a 30-13 San Francisco lead.
Niners' running back Matt Breida made the Lions' defense look silly with a 67-yard touchdown scamper, essentially untouched.
The Lions look to be imploding, down 27-13 with under a minute left in the third.
Matt Stafford continues to struggle to get on the same page with his receivers and passes 10-plus yards down the field are as inaccurate as they've ever been for the veteran quarterback. On a third-and-medium, he missed a wide open Golden Tate over the middle.
Darius Slay went down with an injury and headed to the locker room early in the second half. It has since been ruled a concussion.
Penalties were the name of the game on the Lions' next drive as the momentum was halted thanks to offensive line gaffes.
Detroit settled for a field goal from Matt Prater to make it 20-13, but penalties may have taken away a touchdown drive.
Not long after the long kickoff return, which was called back, the Niners were able to cross the goal-line to put them up 20-10 just two minutes into the half.
The 49ers opened the second half by taking the kickoff back for a touchdown, but it was called back due to a facemask on the return team.
That didn't make Lions fans feel much better.
Tough first half for the Lions as they find themselves down 13-10 after a Matt Prater field goal with seconds left on the clock.
Detroit holds San Francisco to a field goal after the fumble and fans couldn't be happier about the pass rush.
Little victories, right?
Things continue to unravel for the Lions' offense as Matthew Stafford had the ball stripped on third down and the 49ers recovered deep in Detroit territory.
Is this offense capable of making plays?
Matthew Stafford and his receivers don't seem to be on the same page in the second quarter as he misses Golden Tate on third-and-long to force a punt.
To start the second quarter, the Lions' defense looked, well, less than ideal.
San Francisco marched down and scored easily to re-gain the lead, 10-7.
Kenny Golladay took a Matthew Stafford pass down to what looked like the 2-yard line and was ruled a touchdown. It was reviewed and confirmed, and there's plenty of buzz surrounding the second-year wide out.
After allowing a couple of big plays with some penalties along the way, the Lions recorded two sacks and stopped the 49ers, holding them to a long field goal try on fourth-and-goal. The 45-yard field goal was good and the 49ers took an early 3-0 lead.
Still, it was a collective sigh of relief after a shaky defensive showing.
Fans were none too pleased with the Lions' first drive fizzling out at the 50-yard line and play-calling that consisted of no-gain rushes.
Pre-game injury news weighed more on the positive side of things as LeGarrette Blount and Ziggy Ansah are expected to play.
Lions fans are clearly excited about another weekend of football, hopefully not as disappointing as last Monday's blowout loss to the New York Jets.
The Detroit Lions have a 4 p.m. Sunday date with the San Francisco 49ers, as they try to make amends for their season-opening loss to the New York Jets. Connor Muldowney of The Detroit News compiles the best social media reactions during the game.
LIONS VS. 49ERS
When: Sunday, 4 p.m.
Where: Levi’s Stadium, Santa Clara, Calif.
TV/radio: Fox/WJR 760
Records: Both teams 0-1
Line: 49ers by 6