The last time the Bills made the postseason, they lost 22-16 to the Titans in the Music City Miracle game on Jan. 8, 2000.

Between that day and Sunday, they had amassed the longest playoff drought of any team in any of the big four North American team sports. And now the Bills are going back, thanks to the Miracle at the Inner Harbor.

The Bills came into Week 17 needing a victory in Miami and a Ravens home loss to the Bengals in Baltimore. Buffalo took care of its end of the equation in a 22-16 victory over the Dolphins, surviving some anxious moments as a 22-3 fourth-quarter lead dwindled and the Dolphins recovered an onside kick late. Jordan Poyer intercepted David Fales’ long pass with 49 seconds to go, and the Bills were able to head into the locker room and turn their full attention nearly 1,100 miles to the north.

The Ravens were about to extinguish the Bills’ hopes. They’d come back from 24-10 down in the third quarter and had taken a 27-24 lead. It was fourth-and-12 for the long-out-of-contention Bengals with 53 seconds to go. And Andy Dalton hooked up with Tyler Boyd, a rookie who’d entered the day with 17 career catches. Boyd went the distance — 49 yards — oh, Boyd, he did!

“I’m so excited for our players and fans,” Bills coach Sean McDermott said. “Everyone has sacrificed so much to be here. Thank you to the Bengals.”

“I love this team!!!! And Andy Dalton!!!” tweeted backup offensive lineman Ryan Groy.

The Bills are the sixth seed in the AFC and will head back to Florida to face the third-seeded Jaguars in Jacksonville next week. That team is coached by Doug Marrone, who left the Bills after two seasons following a 9-7 mark in 2014, their first over-.500 record since 2004. The Bills, who are 7 ½-point underdogs, will have to hold their breath that LeSean McCoy can return from an ankle injury he suffered Sunday.

McDermott did in his rookie season as head coach what Gregg Williams, Mike Mularkey, Dick Jauron, Chan Gailey, Marrone and Rex Ryan all could not do in Buffalo.

Another interesting result to come out of Week 17 was that the Rams seemingly did not get their wish. They sat Jared Goff, Todd Gurley and other starters in apparent hope of dropping to the four seed to set up potential NFC second-round game at Philadelphia instead of Minnesota. The Rams got crushed, 34-13 (Jimmy Garoppolo’s fifth win in a row as 49ers starter), but ended up the three seed anyway thanks to the Saints’ loss to the Buccaneers.

That’s a catch?!

Just when everyone was getting used to looking for whether a receiver “survived the ground” to complete the process of a catch, we get the next-to-last play of the first half Rams-49ers. With nine seconds to go, Sean Mannion, playing in place of Jared Goff, threw a pass deep down the left sideline to Mike Thomas. The receiver caught the ball but as he was coming down he was walloped by Adrian Colbert. As Thomas hit the ground out of bounds, the ball popped out.

The ball surprisingly was spotted at the 49ers 3, and as the booth called for a review, former NFL chief of officials Dean Blandino explained on FOX that this should be an incomplete pass. But then — surprise!!! — the call on the field was upheld. The Rams kicked a field goal to close within 20-6, and within moments, Blandino tweeted: “In #SFvsLA — the receiver has to clearly become a runner before going to the ground in order for it to be a catch. Contact occurred at the same time second foot hit the ground. At that point, he has to hold onto it all the way to the ground.”

Oh he does, does he? Apparently not. The bottom line is the NFL doesn’t know what’s a catch and what isn’t a catch anymore. Tell Steelers fans that was a catch and Jesse James’ against the Patriots was not.

Play of the Day

Dalton found Boyd open down the right seam at the 23. Boyd spun to his left to get around Maurice Canady and averted a last-ditch swipe by Brandon Carr inside the 5. The Bengals later posted on Twitter: “For all the @buffalobills fans … Happy New Year”

Bad Beat

You’ve got the Bears plus-11 at the Vikings. Trailing 23-10, Chicago has the ball first-and-goal from the 2 with 3:53 to go. But the Vikings are in no mood to cede those 2 yards and the backdoor cover, as a victory clinches the No. 2 seed in the NFC and a bye. The Vikings get the goal-line stand as the Bears go no gain on a run, no gain on a pass, incomplete and 1 yard on a fourth-down pass from Mitchell Trubisky to Tarik Cohen.

Post Patterns

Jack Del Rio was gracious after his firing by the 6-10 Raiders, saying it’s a “results business” and that he’ll be rooting for his successor. There’s a lot of noise that it will be Jon Gruden, who hasn’t coached since 2008. Last year, Del Rio led the Raiders to 12-4, their first winning record since 2002. He seemed to be a perfect fit there. Tough, tough business. … The Titans are in the playoffs for the first time since 2008, when they went 13-3 but lost in the divisional round to the Ravens, 13-10. Marcus Mariota, the second pick in the 2015 draft, gets there in his third season. Jameis Winston, the top pick, still has not made it to the postseason with the Bucs. … Patrick Mahomes II threw for 284 yards, with no touchdowns and an interception in the Chiefs’ 27-24 victory at Denver. He led a 67-yard drive to set up Harrison Butker’s game-winning field goal at the gun. The Chiefs move on into the playoffs and Alex Smith will return under center next week at Arrowhead against the Titans. But did Mahomes show enough to push Smith out the door and take the job for himself. Teams that need quarterbacks and may have an interest in Smith are waiting for that answer. … The Browns joined the 2008 Lions as the only teams to go 0-16, and their 1-31 mark is the worst two-season record in NFL history. But after the game, the Browns confirmed coach Hue Jackson will return.

Three Stars

1. Philip Rivers, Chargers QB

The Chargers didn’t get the help they needed to make the playoffs, but Rivers held up his end, throwing for 387 yards and three TDs in a 30-10 win over the Raiders.

2. JuJu Smith-Schuster, Steelers WR

Smith-Schuster caught nine passes from Landry Jones for 143 yards and a touchdown and reeled off a 96-yard kickoff return touchdown in the Steelers’ 28-24 win over the Browns.

3. Chris Godwin, Buccaneers WR

Godwin had only 27 receptions this season, but he caught seven balls for 111 yards, including a 39-yard TD pass from Jameis Winston with nine seconds to go, to enable the Bucs to shock the Saints.

He said what?

“Dear Bengals … After we handled business in Miami, we needed you, and you came through bigtime. On behalf of this team, the people of the City of Buffalo, and Bills fans around the world, thank you. Thank you. THANK YOU! Wings on us. (No really, we’re sending wings.) With love, The Buffalo Bills”

— Message on Bills Twitter account

Fantasy Insanity

Russell Wilson continued his wild half-to-half swings. After the first half Sunday vs. the Cardinals, he had a whopping 3.4 fantasy points (36 passing yards, 17 rushing yards). He threw two second-half TDs and finished with 221 passing yards and 36 on the ground for steady 20.4-point day.

Over the previous three weeks, Wayne Gallman got more usage in the Giants’ running game than backfield mate Orleans Darkwa. That trend unexpectedly shifted in Darkwa’s favor Sunday, and he cashed in with 154 rushing yards, including an early 75-yard touchdown run. Gallman totaled just 89 yards, though he did appear to have a late TD, but in a meaningless game the call was not challenged.

If you were gambling on a big day by a sub while normal starters rested, the one that paid off best was Albert Wilson. The Chiefs receiver, who previously had just 32 receptions all season, racked up 10 catches and 147 yards (good for 24.7 PPR points) with backup QB Patrick Mahomes II in a win over the Broncos.

— Drew Loftis