Looking like the NFL's worst team for the first three quarters, the Lions came alive in the final period.
Jason Hanson kicked a 38-yard field goal midway through the quarter and Charlie Batch threw an eight-yard touchdown pass to running back Reuben Droughns with 1:49 left, allowing the Lions (0-8) to tie the game.
But that left enough time for the Buccaneers, who took over on their own 20. Brad Johnson kept the game-ending, eight-play drive alive, finding Keyshawn Johnson on third and three for 18 yards that moved the ball to the Tampa Bay 45. The play was reviewed, but Keyshawn Johnson was ruled to have been inbounds.
"With a minute to go, that was a big play for us," Brad Johnson said. "It was actually a corner route. We were trying to get to that all day long. We finally set him up and he did a great job keeping his feet in. That drive kept our season alive. Whether we win in overtime or not, we had to find a way to win and we did."
Two plays later, Brad Johnson put the Buccaneers in position by finding running back Warrick Dunn for 23 yards to the Detroit 26. Gramatica came on three plays after that to kick the winning field goal.
"It's amazing to get a win on the road like this. It was special day. It's my dad's birthday," Gramatica said.
"This was the most important game in my seven years," said Bucs defensive tackle Warren Sapp, who had two sacks. "If you lose to an 0-7 team, you know what that does to morale?"
Among the favorites in the NFC to reach the Super Bowl, the Buccaneers evened their record at 4-4. Tampa Bay entered the contest a game under .500 after seven games for the fourth straight season.
"Road wins are tough to get and this has been a tough place for us," Tampa Bay coach Tony Dungy said. "There were some things we could have done a little bit better. But you have to give (Detroit) a lot of credit to be 0-7 and fight back like that."
With their defense dominating for much of the game, the Bucs received a huge play on the final snap of the third quarter when Karl Williams returned a punt 84 yards for a touchdown, giving Tampa Bay a 17-7 advantage.
But Batch, who was ineffective for the first three quarters, got the Lions moving over the final 12 minutes.
After Desmond Howard returned a punt 12 yards to the Detroit 43, Batch had completions of 13 and 22 yards, moving the ball inside the Tampa Bay 15. But the drive stalled and Hanson came on and kicked a 38-yard field goal with 7:36 left.
"There are a high percentage of games that are close every week and good football teams win the close games," Lions rookie coach Marty Mornhinweg said. "Some great things happened on the field for us today. But there were a few things that were disappointing. Good football teams make the breaks go their way. They make things happen. And they win the turnover ratio."
The Lions' defense rose to the occasion on the ensuing possession, forcing Tampa Bay to go three-and-out.
Batch, who completed 21 of 39 passes for 239 yards with one touchdown and two interceptions, followed with his most impressive drive of the day -- a nine-play, 61-yard march.
On the drive, Batch had a 20-yard completion to fullback Cory Schlesinger and a 14-yard connection to Bert Emanuel. He also ran three yards on a third and one play, moving the ball to the Tampa Bay seven.
Batch saved his best for last, finding Droughns on third and eight for a touchdown, tying the game. Droughns, who played in place of the injured James Stewart, carried 13 times for 30 yards. He also had three catches for 17 yards.
But Brad Johnson, who went 20 of 37 for 188 yards and one touchdown, was able to lead the Bucs down the field in the waning moments.
"Nobody ever imagined this (record)," Batch said. "It's tough. Nobody likes losing, but you can't sit back and point fingers. We have to go out there and find some way to put it together and have a positive season. If we were getting blown out, it would be one thing. But to keep losing by three or four points a game is tough to swallow."
Johnson could have had another touchdown pass, but he had a throw by Reidel Anthony dropped in the end zone in the first quarter. The Bucs then botched the snap on a short field goal, keeping the game scoreless.
The Lions had a chance to break on top early in the second quarter, moving into Tampa Bay territory before cornerback Ronde Barber came up with the first of his two interceptions at the 20.
Tampa Bay drove down field and settled for a 37-yard field goal by Gramatica before coming up with another big defensive play on the Lions' next possession.
Rookie Mike McMahon, who played one series in place of Batch in last week's loss at San Francisco, came on for one series of plays in this contest.
That quickly turned to disaster as McMahon fumbled on his third play and defensive end Chartric Darby recovered for the Bucs on the Detroit 30.
Four plays later, Johnson dumped off a pass for Dunn, who raced 12 yards for a touchdown, giving Tampa Bay a 10-0 lead with 1:52 left before halftime.
A big play by the Lions on special teams finally helped get them on the board in the third quarter. Williams fumbled a punt and Brock Olivo recovered for the Lions at the Tampa Bay 26.
Defensive end Marcus Jones helped aid the ensuing drive, hitting Batch out of bounds for a roughing penalty. Schlesinger eventually scored on a one-yard run, pulling the Lions within 10-7 with 2:51 left in the period.