SAN FRANCISCO - A week after getting knocked out of playoff contention, the San Francisco 49ers started slowly against Detroit.
They put it together in the second half to move one step closer to their only big goal left - avoiding a seventh straight losing season.
Frank Gore scored on a 1-yard run and topped the 1,000-yard mark for the fourth straight year, and the 49ers took advantage of six turnovers to beat the Lions 20-6 on Sunday.
Alex Smith threw a touchdown pass to Vernon Davis and the Niners (7-8) scored both their touchdowns in the third quarter to close out the home season with a victory. San Francisco needs to win at St. Louis next week to finish at .500.
"I think it's a matter of pride," Smith said. "It's what we're playing for right now. We haven't finished better than 7-9 since I've been here. It's something we're all playing for."
Drew Stanton struggled in his first career start for the Lions (2-13), throwing for just 130 yards and three interceptions before being pulled for Daunte Culpepper midway through the fourth quarter.
Detroit lost its fifth straight game and 20th in a row on the road, failing to score a touchdown.
"Last week we said the true measure of a quarterback is his ability to move the team and put points on the board, and we didn't get that done today," coach Jim Schwartz said. "We didn't score touchdowns, we didn't move the team, we didn't get third-down conversions and we turned the ball over too much. It doesn't matter how Drew performed, the offense didn't perform well and ultimately that's the quarterback's responsibility."
Stanton replaced Culpepper last week as the Lions search for a quarterback with rookie starter Matthew Stafford sidelined for the rest of the season with a shoulder injury. Schwartz wouldn't say who will start against Chicago next week.
San Francisco didn't fare much better until getting a pair of touchdowns in the third quarter to pull away. The first came when Smith rolled out on third-and-goal from the 2 and flipped a pass to Davis just before crossing the line of scrimmage.
Smith could have easily run it in but instead got the ball to Davis for his 12th touchdown catch of the season, one shy of Antonio Gates' record for tight ends.
On the next drive, Smith found a wide-open Gore on fourth-and-1. Gore scampered to the 6 on a 48-yard gain. Two plays later, he dived in from the 1 to make it 20-3.
San Francisco coach Mike Singletary thought the sluggish start could be attributed to the holiday week or the fact that the Niners had been eliminated, but was pleased with the way his team finished.
"The bottom line is we came out in the second half and picked it up and got going and began to execute and created some things," Singletary said.
Gore ran for 71 yards on 28 carries. He has 1,013 yards rushing, becoming the first Niners player to reach 1,000 four times in a career.
"It means a lot," Gore said. "It was an up-and down season. I missed a couple games. It was tough, a tough year. It was a blessing. I have to give it all to my O-line. They did a great job."
Smith went 20 for 31 for 230 yards and his career-high 17th touchdown pass of the season as he tries to solidify his hold on the starting quarterback position heading into next season.
The Lions moved the ball well on their first drive, going 76 yards in 15 plays to set up a 27-yard field goal by Jason Hanson. Detroit had only three more first downs the rest of the half, losing two fumbles and throwing an interception to give San Francisco good field position for much of the half.
"It's his first start. We have to build our chemistry with him," receiver Calvin Johnson said of Stanton. "It's going to be tough for a young quarterback coming out his first time but there's plays that a lot of people left out there on the field. You can't have that stuff. We were able to hang in the first half but in the second half it was kind of the same old story. We stalled there a little bit and couldn't get anything going."
The Lions didn't score again until Hanson kicked another field goal late in the fourth quarter after Culpepper came in and the game had long been decided.
The Niners could not capitalize with points off any of those miscues, each of which gave San Francisco the ball near midfield. Gore was stuffed on fourth-and-1 after Stanton fumbled, the 49ers had to punt after a fumble by Johnson and Grady Jackson blocked a 28-yard field goal attempt by Ricky Schmitt in the closing seconds of the half.
Schmitt, signed this week to replace injured Joe Nedney, make a pair of field goals earlier in the half to give San Francisco a 6-3 lead.
NOTES: Lions LB Larry Foote missed the game with a foot injury, ending his streak of 94 straight starts. ... Niners LT Joe Staley left with a bruised knee early in the second half. ... The blocked kick was the 24th by the Lions since the start of the 2001 season, most in the NFL.