Aided by a ridiculous Baltimore Ravens loss and a barely conscious performance from their own opponents, the Buffalo Bills will head to the NFL playoffs for the first time since 1999. The Bills did all they could do, beating Miami 22-16 in a game that was nowhere near as close as the score, but their playoff hopes were pinned on the slimmest of chances: an Andy Dalton two-minute drill.

Joe Flacco and the Ravens turned around a 24-10 third-quarter deficit to lead the Cincinnati Bengals, 27-24, in a scoreline that would have punched the Ravens’ ticket to the Wild Card round instead of the Bills. But the already eliminated Bengals didn’t give up, driving 90 yards down the field to retake the lead with a last-minute 49-yard fourth-down receiving TD from Tyler Boyd. Cincy’s 31-27 victory broke the longest playoff drought in all major American sports and forever endears them to Tyrod Taylor and the Bills. Here’s the winning score:

Buffalo will face Jacksonville next weekend, while fellow Wild Card team Tennessee will travel to Kansas City.