OAKLAND, Calif. (AP) Matt Schaub ended his first home game with the Oakland Raiders on a high note.
Schaub led a touchdown drive to cap an up-and-down performance, and the Raiders rallied behind Matt McGloin's 19-yard TD pass to Brice Butler with 6 seconds remaining to beat the Detroit Lions 27-26 in an exhibition game Friday night.
''There are a lot of things we have to learn from, but it's a lot better to do that after the win,'' coach Dennis Allen said.
Schaub threw a deflected interception on his first drive and struggled to move the Raiders on his next two drives before leading a 60-yard march capped by Darren McFadden's 1-yard run.
Schaub finished 8 for 13 for 87 yards and looked sharper than he did in last week's exhibition loss at Minnesota.
''I felt comfortable,'' he said. ''Got in a little bit of a rhythm offensively with the guys, getting in and out of the huddle and executing some things. It just felt good.''
Rookie Derek Carr led Oakland on three scoring drives before leaving in the fourth quarter with a concussion and sore ribs. That set the stage for McGloin to drive the Raiders 68 yards in the closing minutes.
McGloin, who started most of the second half of last season, has fallen to third string after the offseason additions of Schaub and Carr.
''It's tough standing over there for hours,'' he said. ''Unfortunately Derek got hurt. That's a tough situation for any quarterback, coming in in that situation. But it felt good to get in and get some work in.''
Matthew Stafford threw TD passes on his first two drives, connecting on a 28-yard pass to Golden Tate on Detroit's second play from scrimmage and a 4-yard score to Kris Durham.
The Lions' first-team offense looked sharp even with Calvin Johnson held out of his second straight preseason game, but ended up losing it with their reserves late.
Schaub started well in his first home game with the Raiders, converting a pair of third downs before his throw to James Jones in coverage was deflected and intercepted by James Ihedigbo.
Two plays later, cornerback Tarell Brown bit on a double move and Tate raced past him to catch a 28-yard score.
Kicker Nate Freese hit the upright on the extra point from the 15-yard line. Freese, in a competition with Giorgio Tavecchio, made up for that with a 55-yard field goal in the closing seconds of the half.
Stafford picked apart Oakland's defense in his limited action, completing 9 of 10 passes for 88 yards and capping the second drive when Durham outjumped TJ Carrie for the 4-yard score.
Stafford completed passes to five receivers on three drives before calling it a night.
''Obviously, Calvin wasn't out there today so a lot of guys got opportunities and made the most of them today,'' Stafford said. ''That's what we're looking for this time year.''
Backup Dan Orlovsky also had success, going 8 for 12 for 153 yards and leading an 83-yard TD drive to open the second half.
Schaub at least ended his night on a positive note with the touchdown drive. Schaub nearly had a pass intercepted by Rashean Mathis early in the drive when he was late on an out pass to Rod Streater.
But Schaub was helped out by a pair of penalties on Detroit after the Lions had appeared to stop the drive and then threw a 22-yard screen pass to Maurice Jones-Drew to set up the score.
Carr led the Raiders to a field goal on his first drive, throwing a 16-yard pass to Jones on a rollout for the key play.
After stalling on his first drive of the second half, Carr completed all six passes for 76 yards on a touchdown drive capped by a 3-yard pass to Jake Murphy.
But Carr left the game holding his ribs later in the fourth quarter after the hard hit from Larry Webster.
''He's got sore ribs,'' Allen said. ''I don't know exactly what his ribs are but the concussion was why he was out of the game.''
Carr went 9 for 16 for 109 yards and looked comfortable in the pocket against Detroit's reserves.
NOTES: S Tyvon Branch (ankle), Jones-Drew (finger), TE Scott Simonson (concussion) and OL Matt McCants all were hurt for the Raiders. ... Lions S DeJon Gomes left with a neck injury after a hard hit on Simonson that forced a fumble.
AP NFL websites: www.pro32.ap.org and www.twitter.com/AP-NFL