DETROIT -- Matthew Stafford stayed cool and calm after the shakiest first half of his career.
Stafford threw a five-yard touchdown pass to Kevin Smith with 10 seconds left, lifting the Detroit Lions to a 27-23 win over the St. Louis Rams on Sunday.
The No. 1 pick from the 2009 NFL draft had three interceptions before halftime for the first time.
The Rams scored 13 points off Stafford's turnovers, including Cortland Finnegan's 31-yard return for a TD that gave them a 13-7 lead late in the first half, but they couldn't stop him in the end.
Stafford led an 80-yard, nine-play, game-winning drive that included three passes of at least 18 yards and was capped by enough patience in the pocket to connect with a wide-open Smith.
"Kevin was the last option on that play, probably behind throw it away because he was part of the play action and protection," Detroit coach Jim Schwartz said. "The head coach was on the headphones, 'Throw it away Matt, throw it away!' It shows you what a good quarterback I'd be."
Stafford finished 32 of 48 for 355 yards.
Detroit's All-Pro receiver Calvin Johnson caught six passes for 111 yards, including an 18-yard grab just before Smith was left alone for his second TD of the game. On the pivotal play, the Rams double-covered Johnson and linebacker Jo-Lonn Dunbar seemed to lose sight of Smith.
"I knew in that formation Calvin would get all of the attention," Stafford said. "That's exactly what happened."
Sam Bradford, the No. 1 overall pick a year after Stafford, directed a go-ahead drive that set up Greg Zuerlein's 46-yard field goal to put the Rams ahead 23-20 with 1:55 left.
St. Louis coach Jeff Fisher, who is leading a franchise coming off the worst five-year span since the 1970 NFL-AFL merger, put together a conservative game plan that almost worked.
"Our plan was to try to hold them to field goals ... and then take your shots offensively," Fisher said. "Get your points and have a chance to win the game at the end."
Bradford was hit by defensive end Cliff Avril on the game's last play, leading to some pushing, shoving, and shouting that didn't get out of hand in part because the officials separated the players. The replacement officials included line judge Shannon Eastin, who became the first woman to officiate an NFL regular-season game.
Steven Jackson gained just 53 yards on 21 carries for an offense that couldn't take enough time off the clock on its next-to-last drive to prevent Stafford from getting the ball back.
"Give the Lions credit, they made the big plays they needed at the end of the game," Finnegan said. "We did some really good things, but we've got to learn how to finish. That will come."
St. Louis' reshaped offensive line lost two starters during the game. Offensive tackle Rodger Saffold was carted off the field with a neck injury in the fourth quarter, and center Scott Wells had a foot injury.
Fisher said Saffold was alert and had strength in his arms and legs.
"This is more of a precautionary deal," Fisher said. "There's a chance he'll come home with us."
Bradford was 17 of 25 for 198 yards with a TD, a 23-yard pass to Brandon Gibson early in the fourth quarter that put the Rams up 20-13.
"We gave ourselves a chance to stay in the game and win it at the end," Fisher said. "I think we got better as a team."
Early on, it looked like Stafford had taken a step back after throwing for 5,000-plus yards, 41 TDs, and 16 interceptions last season to help Detroit end an 11-year postseason drought.
Rookie Janoris Jenkins jumped a route and intercepted Stafford's pass on the goal line to end his first drive, Dunbar stepped in front of another attempt and picked it off. Finnegan took advantage of an ill-advised throw across the field and returned it for a TD in his Rams debut.
"We did a ton of film study on Stafford, and we knew what he likes to do," Finnegan said. "Our coaches gave us a great game plan ... We just needed to make one more play."
Stafford, though, was the one who came up with the clutch plays to avoid an upset in the opener for both teams.
"It wasn't like he was just having a bad day," Schwartz said. "He had a couple of bad plays.
"You have to have a demeanor that allows you to come back from that."
NOTES: Replacement official Paul Caldera left the game in the third quarter with an apparent leg injury. He was replaced by an alternate -- a replacement for the replacement. ... Detroit WR Titus Young was called for unnecessary roughness after he head-butted Jenkins. "It was right in front of me the whole time," Schwartz said. "It looked like he was going to walk away and do the right thing and then he made a dumb decision." ... Fisher hired Schwartz in 1999 to be on his staff at Tennessee and promoted him two years later to the Titans' defensive coordinator, a job he had until Detroit gave him his first shot to be a head coach three years ago. ... Lions rookie CB Bill Bentley left the game with a concussion. ... St. Louis WR Danny Amendola had five catches for 70 yards.