PHILADELPHIA — Sam Bradford and a tenacious defense ruined LeSean McCoy’s homecoming.

Caleb Sturgis kicked a 30-yard field goal with 3:26 left, Ed Reynolds intercepted Tyrod Taylor’s pass in the final minutes and the Philadelphia Eagles beat the Buffalo Bills 23-20 on Sunday.

McCoy had 74 yards rushing and 35 receiving in his return to Philadelphia. The two-time All-Pro kissed the Eagles logo at midfield before the coin toss and hugged owner Jeffrey Lurie.

He was the first player off the field after the game, sprinting toward the locker room immediately when the clock expired and slammed his helmet into the wall.

“I got nothing to say,” he told a crowd of reporters around his locker.

The Eagles (6-7) and Redskins (6-7) are tied atop the NFC East. The New York Giants (5-7) could make it a three-way tie with a win at Miami on Monday night.

advertisement | advertise on newsday

The Bills (6-7) fell two games behind in the AFC wild-card race.

Taylor’s streak of 222 passes without a pick ended when his deep pass went right to Reynolds with 1:16 remaining.

Bradford threw for 247 yards, including a 53-yard TD to Nelson Agholor. The Eagles are 6-2 in the past eight games Bradford has started and finished.

“I feel more comfortable, more confident in what we’re doing,” he said.

McCoy, the Eagles’ all-time leading rusher, was dealt to Buffalo for linebacker Kiko Alonso last March. He was bitter about the trade and criticized coach Chip Kelly several times afterward.

NFL videos

He never approached Kelly after saying last week he didn’t want to shake his hand or talk to him.

Fans gave McCoy a mixed reaction before the game with some cheers and a few boos. Many wore No. 25 jerseys in Bills and Eagles colors.

Philadelphia’s Fletcher Cox threw McCoy down for a 10-yard loss in the second half and shoved him hard when he was down.

The Bills rallied from a 20-10 deficit in the third quarter.

One play after Taylor ran 14 yards on third-and-13, Mike Gillislee had a 19-yard TD run to tie it at 20-20. Buffalo started that drive at the Eagles 46 after an unsportsmanlike penalty on Philadelphia’s Riley Cooper on a punt.

advertisement | advertise on newsday

The Eagles had a first down at the Bills 24 on the next series before Bradford threw his first interception since Oct. 25. Leodis McKelvin leaped and snatched the ball away from Brent Celek at the 5.

But Bradford tossed a 41-yard pass to Zach Ertz on third-and-3 to set up Philadelphia’s go-ahead field goal.

“Sam played outstanding,” Kelly said.

The Bills had two chances in the final minutes, but couldn’t do much. They were hurt by 15 penalties.

“I thought we were the better team, but obviously we got beat,” Bills coach Rex Ryan said. “We have ourselves to blame.”

advertisement | advertise on newsday

After Darren Sproles ran in from the 1 for a 7-0 lead on Philadelphia’s first drive, the Eagles went three-and-out three straight series.

The Bills tied it at 7 when Taylor connected with Sammy Watkins on a 47-yard TD down the right side.

One week after two touchdowns on special teams helped the Eagles upset New England, another big play on a punt got Philadelphia going. Bryan Braman recovered Marcus Thigpen’s fumble at the Buffalo 37. Following consecutive holding penalties, the Eagles faced second-and-26 when Bradford hit Agholor over the middle for the rookie first-round pick’s first TD catch and a 14-7 lead.

Sturgis made a 45-yard field goal for a 17-10 lead at halftime. He extended the lead to 20-10 on a 41-yarder on the first possession in the third quarter.

Dan Carpenter made field goals of 38 and 40 yards for Buffalo.

Notes: Bills were missing rookie RB Karlos Williams and three starters: CB Stephon Gilmore, LB Nigel Bradham, OL Seantrel Henderson. TE Charles Clay left in the first half with a back injury. ... Watkins is first Bills receiver with 40-yard catches in three straight games since Terrell Owens in 2009. ... Eagles EB DeMarco Murray had 11 carries for 34 yards.