Put simply, the Miami Dolphins were due.

They had been on a disastrous stretch against the Buffalo Bills, with one touchdown in a span of 33 possessions overlapping four games — three of which they lost, the fourth one looking like it would have the same outcome.

"I wasn't aware of that statistic," Miami coach Joe Philbin said. "Certainly didn't pass it along to the team."

Then came a breakthrough, and just like that the Dolphins' playoff chances look a whole lot more realistic.

Ryan Tannehill threw touchdown passes on back-to-back drives in a five minute span in the second half, Miami's defense held Buffalo without a touchdown and the Dolphins beat the Bills 22-9 on Thursday night.

"The team felt, the offense especially, felt confident in what we were doing," Tannehill said. "We were able to move the ball, do exactly what we wanted to do. ... I think we did that in the second half, played more clean."

The Dolphins (6-4) moved into sole possession of second place in the AFC East, 1 1/2 games behind New England — a team Miami beat in Week 1.

Tannehill completed 26 of 34 passes for 240 yards and the two scores to Brandon Gibson and Jarvis Landry. Lamar Miller rushed for 86 yards on 15 carries for Miami and the Dolphins' defense held Buffalo to 86 yards on 30 plays after halftime.

Dan Carpenter kicked three field goals against his former team, accounting for all of Buffalo's scoring. The Bills (5-5) had beaten the Dolphins in each of the teams' last three meetings, but left the game looking up at 10 other teams in the AFC standings.

"We've got to score," Bills coach Doug Marrone said. "This was a team loss. There's no doubt about that when you look at all the things that happened out there tonight. ... We lost this game as a team."

Here's what to know after Miami's win over Buffalo:

TANNEHILL'S NUMBERS: Sure, the NFL quarterback rating formula is complex and isn't the sort of thing most people can figure out in their head. But when it comes to Tannehill, figuring out what that rating means is simple. When his rating is 91.0 or better in a single game, the Dolphins are now 16-0. When it's less than 91.0, the Dolphins are 5-21. His rating Thursday night: A tidy 114.8, the fifth-best showing of his 42-game career.

RELIABLE CARPENTER: Carpenter has 15 field goals against the Dolphins in the past two seasons, the most anyone has ever made against Miami in that span. He was 7 for 7 last year against his former club, and was 8 for 10 in the two Miami-Buffalo games this season. The only other kicker with so many field goals against the Dolphins in a single season was Roy Gerela, who went 8 for 8 in two Miami meetings for the Houston Oilers in 1969.

GIBSON, AGAIN: Gibson has four touchdown receptions in his two seasons with the Dolphins — and three of those scores have come against the Bills, including the one that helped put Miami ahead for good on Thursday night. He had two touchdown grabs in Miami's 23-21 home loss to the Bills last season. His only other scoring catch with Miami came against New England on Oct. 27, 2013.

COMING UP: The Bills have six games left, four of them against playoff hopefuls (Cleveland, Denver, Green Bay and New England, currently a combined 26-10), and two against struggling clubs (the New York Jets and Oakland, currently a combined 2-17). Miami's next two games are at Denver and the Jets. Then the Dolphins finish with Baltimore, New England, Minnesota and the Jets again. "We just have to keep this momentum going," Dolphins defensive end Jared Odrick said.

WEATHER WOES: Thursday night was not good for the Bills, and what awaits them back in Buffalo probably won't make them happy, either. The first measurable snow of the season fell over much of Western New York on Thursday, leaving roads slippery and causing plenty of accidents in the Buffalo area. At kickoff Thursday night, it was 30 degrees in Buffalo — 44 degrees colder than the air in South Florida.

___

AP NFL website: www.pro32.ap.org and http://twitter.com/AP_NFL