TAMPA, F.L. (WIVB) — It was the tale of two halves for the Bills in Tampa Bay on Sunday afternoon, but in overtime the Buccaneers overtake Buffalo 33-27.

After a disappointing loss to the Patriots on Monday Night Football in Week 13, the Bills had a tough test in the Tom Brady-led Buccaneers to look to get back on track and stay in a Wild Card position in the AFC.

The Buccaneers controlled the entire first half, scoring three touchdowns and a field goal in the first two quarters, all the while keeping Buffalo out of the end zone, to lead the Bills 24-3 at the half.

But that’s when the Bills flipped the script. The Bills gave up only one field goal to the Bucs in the second half and went on to score three touchdowns and a game-tying field goal of their own with just 22 seconds left in the game to end regulation tied up at 27 a piece.

But in overtime, the Bills punt it away, and on Tampa Bay’s possession, Brady connects with Breshad Perriman for a 58-yard touchdown to end it.

Josh Allen finishes 36-54 for 308 yards, two touchdowns and an interception. He also led all rushers on the Bills, and ran for 109 yards on 12 carries and a rushing touchdown.

Buffalo moves to 7-6 on the season.

HERE’S HOW IT HAPPENED:

— 1Q: After trading punts to open up the game, on the Bucs second possession, Leonard Fournette breaks free for a 47-yard touchdown run. 7-0 Buccaneers.

— 2Q: Tampa Bay takes it 80-yards in 15 plays and finishes with a 23-yard field goal. 10-0 Buccaneers.

— 2Q: The Bills put together a 72-yard drive, including three 20+ receptions to Emmanuel Sanders, Stefon Diggs and Gabriel Davis, but can’t get over the goal line and settle for a 21-yard Tyler Bass field goal. 10-3 Buccaneers.

— 2Q: Tom Brady takes a shot high and in the back corner of the end zone but Mike Evans makes the insane jumping catch for the touchdown. 17-3 Buccaneers.

— 2Q: Bucs take it 72-yards down the field and cap of the drive with a one yard touchdown up the middle by Brady. 24-3 Buccaneers.

— 3Q: After the Bills take over on downs, they go 81-yards in 9 plays, including the Bills first run play by a running back of the game, and cap off the drive with an 18 yard touchdown run by Josh Allen. 24-10 Buccaneers.

— 4Q: Bucs kick a 24-yard field goal. 27-10 Buccaneers.

— 4Q: Buffalo goes 75-yards in five plays and finish with a 15-yard dart from Allen to Dawson Knox. 27-17 Buccaneers.

— 4Q: After a short Tampa punt, the Bills take over in Bucs territory. Nine plays and 46-yards later, Allen connects with Gabriel Davis for the 4-yard touchdown. 27-24 Buccaneers.

— 4Q: The Bills tie the game with just 22 seconds left after taking it 70-yards, and finish with a 25-yard Bass field goal. 27-27 at the end of regulation.

— OT: After the Bills punt it away in overtime, Brady hits Breshad Perriman for a 58-yard game winning touchdown. 33-27 Buccaneers.