MIAMI GARDENS, Fla. (AP) -- Safety Aaron Williams stood at his locker shortly after midnight, contemplating years of accumulating frustration with the Buffalo Bills, including the game just ended.
"I'm tired of it, we're all tired of it, and we know the fans are tired of it," Williams said. "It hurts."
The Bills, trying to end a 14-year playoff drought, backslid yet again Thursday night. They stalled on offense, squandered a lead late in the third quarter and lost to the Miami Dolphins 22-9.
The Dolphins trailed 9-3 before outscoring their AFC East rivals 19-0 over the final 18 minutes. Miami snapped a three-game losing streak against Buffalo.
"It was great to swing the tide," Miami receiver Jarvis Landry said. "It was good not to be the little brother."
Buffalo fell to 5-5 with its second loss in a row. A victory would have given the Bills their best record at the 10-game mark since 2000.
The Dolphins improved to 6-4, their best record after 10 games since 2008.
"To stay over the .500 mark, to win in the division and to beat the Bills, it's a good night," defensive tackle Jared Odrick said.
Ryan Tannehill shook off five sacks to throw late touchdown passes of 7 yards to Brandon Gibson and 8 yards to Landry. Tannehill went 26 for 34 for 240 yards, and Lamar Miller rushed for 86 yards.
Stymied by Buffalo's front four in recent meetings, the Dolphins had scored one touchdown in 33 possessions against the Bills before late TD drives of 80 and 63 yards. Otherwise stout defense did the heavy lifting for Miami, which scored a safety on a penalty. Quarterback Kyle Orton had an unproductive night and injured a toe late in the game.
"We need to try to get better, and it starts with the quarterback," Orton said. He didn't say whether his injury was serious.
Orton went 22 for 39 for 193 yards, and the Bills netted only 54 yards on the ground. Their top two running backs were out with injuries.
Coach Doug Marrone said he's not considering benching Orton - unless he's seriously hurt - in favor of E.J. Manuel, the starting quarterback at the beginning of the season.
The Bills, ranked last in the NFL in red-zone touchdown efficiency, mounted grinding drives of 67 and 85 yards on their first two possessions. But Miami held them to a field goal each time, and those were their best TD chances.
The Bills have reached the end zone once in their past nine red-zone trips.
"In the first half we had two drives we didn't finish," Marrone said. "In the second half we just didn't play well."
With the Dolphins leading 12-9, Landry lost a fumble on a kick return, but their defense again dug in, and former Miami kicker Dan Carpenter missed a 47-yard field goal try. He made earlier attempts of 33, 21 and 46 yards.
The Dolphins, also ranked poorly in red-zone efficiency, missed chances early themselves. They came away with three points from trips inside the 20 on their first two possessions, and didn't reach the end zone until 42 minutes into the game.
Miami led 10-9 before scoring a safety when Orton was flagged for intentional grounding from the end zone. Under pressure from Olivier Vernon, Orton threw a pass that landed closer to the Bills sideline than to any player.
"I think it was the turning point in the game, and momentum really took over," Odrick said. "The spirit of the Dolphins was within us."
The Bills padded their NFL-leading sack total while working against Miami's makeshift line, reshuffled after left tackle Branden Albert's season-ending knee injury last week. But Tannehill kept getting back up, and he finished with a passer rating of 114.8.
"We knew what was on the line in this game," Tannehill said. "I think we came out and executed well."
NOTES: Bills CB Leodis McKelvin, who pledged his team would win, left the game in the first half with an ankle injury. ... For Miami in the second half, reserve CB Will Davis hurt his knee, and reserve LB Jonathan Freeny hurt his hamstring. ... Bills RB Fred Jackson (groin) was inactive.
AP NFL website: http://www.pro32.ap.org and http://twitter.com/AP-NFL
Follow Steven Wine on Twitter: http://twitter.com/Steve-Wine