MIAMI - Ryan Tannehill ended his frustrating afternoon with one final incompletion, then tumbled near the Bills' bench and laid face down as they began to celebrate.
Too many Tannehill sacks and turnovers again doomed the Dolphins, who fumbled away a late lead as the Bills took the lead in the final minute - on former Dolphin Dan Carpenter's field goal - and hung on.
Bills defensive end Mario Williams forced a fumble by sacking Tannehill with less than three minutes left. Tannehill also threw two interceptions.
"We're in a tough spot right now," Tannehill said. "There are two ways we can go. We can tank it, or we can turn it around."
Buffalo ended a six-game road losing streak.
"We needed to get the ball back in good field position," Williams said. "When I came through, I realized I had a shot at it. I thought, 'There's the ball.' Then it came out."