ORCHARD PARK, N.Y. -

Leodis McKelvin scored on a 79-yard punt return and the Mario Williams-led Buffalo Bills oft-maligned defense finally flexed its muscles in a 19-14 victory over the Miami Dolphins on Thursday night.

Safety Jairus Byrd recovered a fumble and made a diving interception, and Bryan Scott sealed the win with an interception to end the Dolphins' final drive. Williams had one of three sacks for a Buffalo defense that limited the Ryan Tannehill-led Dolphins to 184 yards.

More: Miami Dolphins

That was enough to make up for an offense that settled for Rian Lindell's four field goals on four drives into the red zone.

Buffalo (4-6) snapped a three-game skid and won for only the second time in seven games.

Marcus Thigpen scored on a 96-yard kickoff return and Davone Bess had a 2-yard touchdown catch for Miami (4-6), which has lost three straight.