By Dean Michaels

Alex Smith passed six yards to Delanie Walker for the winning touchdown to give the San Francisco 49ers a 25-19 victory over the Detroit Lions Sunday at Ford Field.

It was the first loss of the season for the Lions, 5-1. San Francisco, 5-1, has won five straight.

Smith's TD pass gave the 49ers a 22-19 lead with less than two minutes to play.

David Akers added a 37-yard field goal for the 49ers with a minute to play.

Matthew Stafford passed five yards to Nate Burleson for a touchdown to give the Lions a 19-15 lead early in the fourth quarter.

The pass was initially ruled incomplete by the officials who said Burleson did not have control of the ball before going out of the end zone. The call was overturned by video replay.

The Lions failed in their bid for two points after the go-ahead TD. The 49-yard drive for the Lions was set up by an interception by Amari Spivey.

Akers booted a 31-yard attempt midway in the third to give San Francisco a 15-13 lead. Jason Hanson had booted a 24-yard earlier in the quarter to give the Lions a 13-12 advantage.

Akers booted a 55-yard field goal on the last play of the first half to give the San Francisco 49ers a 12-10 halftime cushion.

Hansen kicked a 25-yard field goal early in the first quarter and Matthew Stafford tossed a 16-yard pass to Brandon Pettigrew later in the period for a 10-0 Lions lead.

The 49ers got to the Lions' 1-yard line late in the first quarter on Frank Gore's 47-yard run. On the first play of the second quarter, Gore ran it in for the touchdown. Midway in the quarter, Stafford was sacked in the end zone by San Francisco's defensive tackle Ray McDonald for a safety.

Detroit was trying to open the season at 6-0 for the first time since 1956. The Lions beat San Francisco 17-13 in 1956 to get to 6-0.

It was 314-299 in total yards for the 49ers over the Lions.

San Francisco 49ers 25-19 victory over previously unbeaten Detroit Lions

NFL 2011 - Perfect No More: 49ers Hand Lions First Loss Of Season