BUFFALO, N.Y. -- All the Buffalo Bills defense had to do was hold off the Philadelphia Eagles for one minute and 52 seconds to complete the upset.

And for a moment during a windy, rainy Sunday, it seemed the Bills had done just that, with penalties pushing the Eagles back on their final drive in regulation to force a 59-yard field goal attempt with 25 seconds left. But Jake Elliott's kick went straight through the uprights to force overtime.

"That was nuts. Obviously, this is the NFL, you understand, you never think you're gonna ... until there's zero time left on the clock, you don't assume you won the game," safety Micah Hyde said. "But that was a hell of a kick ... and it was a line drive too."

Just like that, the Bills had allowed 17 fourth-quarter points and a win to slip away against the team with the NFL's best record. The Eagles won 37-34 in overtime after the Bills had taken a 10-point lead into the fourth quarter.

"I feel like, coming into halftime, we basically had the game won then, you know, but it is what it is, man," defensive tackle Ed Oliver said.

Losing close games has become a theme for the Bills this season. All of the team's losses have come by six points or less, with four of those losses coming on the road (tied with the Green Bay Packers for the most one-score road losses). In four of the team's losses, the defense surrendered a lead in the fourth quarter or overtime.

Four times this season, the Bills defense has taken the field with less than two minutes remaining and had a chance to seal a win. Only once have they accomplished that: against the New York Giants in Week 6 when New York threw an incompletion in the end zone on the last play.

"It's unfortunate. ... We could have nine, 10 wins right now, but that's in fantasy land and in real life, we understand what our record is," Hyde said.

The Bills are on bye sitting at 6-6 with a 21.8% chance to make the playoffs, according to ESPN Analytics. A resurgent offense has played some of its best football under interim offensive coordinator Joe Brady over the last two games (averaging 33 points a game), and the Bills defense has held its own overall -- especially considering the number of injuries it has faced -- ranking sixth in scoring defense (18.9 points per game). But late in games, the unit has been unreliable and fallen short too often.

"We've played well, I would say, defensively in the majority of our games this year, and we get into these one-score situations down the end of the game, and we got to find a way to close it out," said Sean McDermott, in his first year calling the defensive plays as a head coach. 

Why can't the defense hold leads late in games? Hyde said defending end-of-game drives are something the team practices a lot. Oliver couldn't explain the letdowns, but pointed a finger at himself for needing to make more plays. Middle linebacker Terrel Bernard said it comes down to execution.

"Late in the game, when you're tired, you got a lot of snaps going and you just gotta go out there and finish," Bernard said.

When the Bills enter the fourth quarter or overtime with a tie or one-score lead, the team ranks 31st in defensive expected points added (EPA) with minus-5.56 and 30th in defensive EPA per play (minus-0.14). Their total defensive EPA in those situations is worst in the league when the Bills are tied or have a lead of 10 or more going into the final quarter (minus-14.97). In one-score games entering the fourth quarter or overtime, no team in the league has allowed more points per game (11) or a higher third down conversion percentage (62.5%).

Injuries on defense can't be ignored. The Bills have three starters on injured reserve -- defensive tackle DaQuan Jones (pectoral), linebacker Matt Milano (right leg) and cornerback Tre'Davious White (right Achilles) -- and several other defensive players have missed time or dealt with injuries. Veteran pass-rusher Von Miller, returning from ACL surgery on his right leg, is still playing limited snaps and has two tackles in eight games.

"I see a veteran that has shown a lot of mental toughness, a lot of heart and a lot of leadership," assistant head coach and defensive line coach Eric Washington said of the 34-year-old Miller. "Really, a lot of sacrifice. Von didn't wait until he was in an optimal position as far as what he's used to doing. He said I'm going to go out there and give you what I have."

Stopping the run has been a problem, with the Bills allowing the fourth-most rushing yards per game in the fourth quarter or overtime (35.3) and third-most rushing yards per attempt (5.0). Overall, the unit has allowed the second-most first downs per game in the fourth quarter or overtime (6.5). By contrast, they have been allowing the fourth-fewest first downs (12.5) through the first three quarters.

Fixing the late-game letdowns could be imperative, with the Bills slated to face the defending Super Bowl champion Kansas City Chiefs when they return from the bye and almost no wiggle remaining to make a playoff run.

"We've been in close games this year, particularly every one of our losses, as you well know," McDermott said. "And so, we have an opportunity to close games out or pull away. Those are the things that we're studying ... as a staff in making sure that we can continue to close that gap to work for our team."