Updated

Nick Foles found Jeremy Maclin for a 1-yard touchdown as time expired to lift the Philadelphia Eagles past the Tampa Bay Buccaneers, 23-21, on Sunday.

The Eagles trailed 21-10 and put up a touchdown with 3:55 remaining to make it a one-score game, then took over again on their own 36-yard line with just 2:44 left. On 3rd-and-14, Foles found Maclin for a 23-yard completion to keep the drive alive.

Foles turned to Maclin once again on 3rd-and-10 at the Buccaneers' 40, but Maclin could only pick up nine yards. Foles took it himself on 4th-and-1 and quickly spiked the ball to stop the clock with 35 ticks showing.

After three straight incomplete passes, Foles connected with Jason Avant for a 22-yard gain to the Tampa Bay 1-yard line.

Foles sprinted to the line and spiked the ball with two seconds left. Following a Buccaneers timeout, the rookie signal-caller took the shotgun snap and delivered a perfect pass to Maclin, who slid across the end zone on his knees.

"He came off (the field) and he wanted that play. That's the one he liked the best. He was feeling it," said Eagles coach Andy Reid. "Hey, listen, that's a great thing when your quarterback is in tune like that. When he came off he was saying, 'I'm feeling this one right here.' I'm proud of the kid."

It was unclear if Maclin was able to keep his left foot in bounds, but the call was confirmed following an official review.

Philadelphia (4-9) snapped an eight-game losing streak -- the longest since Andy Reid took over as head coach in 1999 -- with the win. Foles finished the game 32-for-51 passing for a career-high 381 yards.

The Bucs (6-7) lost their third straight to fall further behind in the NFC playoff race despite Doug Martin carrying the ball 28 times for 128 yards and a touchdown.

"We have to find a way to make more plays and score more points," said Tampa Bay quarterback Josh Freeman. "That is what the game is all about, winning and losing. Any time you lose a close one it is going to be pretty rough."

Tampa entered the second half trailing 10-0, but caught a break when Philadelphia's Damaris Johnson muffed Michael Koenen's punt and the Bucs took over on the Eagles' 5.

Martin was stopped at the 1 on first down, and after throwing an incomplete pass on 2nd-and-goal, Freeman found Mike Williams for a 1-yard touchdown.

Freeman's 13-yard touchdown pass to Vincent Jackson gave Tampa a 14-10 lead early in the fourth quarter. Earlier in the nine-play trek, Freeman hooked up with Jackson for a 40-yard completion down the left sideline before going back to first-year Buccaneer five plays later for the score.

The Bucs forced a three-and-out on the ensuing possession, then marched 75 yards for their third touchdown of the second half -- a 4-yard Martin rush with 7:21 left to play.

On 3rd-and-7 at the Eagles 40, Freeman found Jackson for a short pass to the right side and he turned it up field for a 28-yard catch-and-run to set up the score.

The Eagles, though, answered back with a touchdown of their own when Foles found Clay Harbor in the back of the end zone from 11 yards out. Philadelphia attempted a two-point conversion to try make it a three-point game, but Foles' pass to Dion Lewis fell incomplete and the Eagles trailed 21-16 with 3:55 left.

After having all their drives end in punts over the first 23 minutes of the game, Alex Henery finally put the Eagles on the board with a 28-yard field goal midway through the second quarter.

Foles' 10-yard touchdown run capped a 7-play, 80 yard drive that put the Eagles up 10-0 late in the first half. The young signal-caller hooked up with Avant on 3rd-and-4 from the Bucs' 49 for a 39-yard catch-and-run and Foles took it in himself on the next play for his first career rushing score.

Henery missed a 58-yarder at the end of the first half, banging it off the left upright, to prevent Philadelphia from extending its lead. Prior the attempt, the Eagles were penalized for a false start. Henery later missed a 31-yarder in the third quarter.

The second-year kicker had made 23 consecutive field goals before the two misses.

Game Notes

Avant had seven catches for 133 yards and Maclin caught nine balls for 104 yards and a touchdown ... Philadelphia running back Bryce Brown rushed for just six yards and 12 carries after amassing 347 yards and four touchdowns in his two previous starts ... The Eagles are 9-7 all-time versus Tampa Bay ... The Bucs are 3-6 against the NFC this season.