Ajayi rushed for 214 yards in 29 carries after totaling 204 yards a week earlier in a win over Pittsburgh. He scored on a 4-yard run , and busted a 53-yarder when the Dolphins were pinned at their 3 and trailing in the fourth quarter.
The Dolphins (3-4) used an extra lineman much of the time to clear big holes for Ajayi, who tied the NFL record for consecutive 200-yard games held by O.J. Simpson, Earl Campbell and Ricky Williams.
Miami overcame an 11-point deficit with 16 minutes left to end a four-game winning streak by the Bills (4-3) and beat them for only the second time in their past seven meetings.
With Ajayi sidelined by cramps, Damien Williams carried half the Bills' weary defense into the end zone on a 12-yard touchdown run that put the Dolphins ahead with 3:56 to go. On their next possession, Ryan Tannehill hit Kenny Stills for a 66-yard score that made it 28-17.
Miami recovered an onside kick with 13 seconds left to seal the victory.
EMERGING STAR: Ajayi, a second-year pro from Boise State, is the only NFL rusher with a 200-yard game this year. He ran for 187 yards as a rookie and totaled 117 in Miami's first five games this year before his breakout.
GIMPY McCOY: While Miami's ground game clicked, Bills running back LeSean McCoy left in the third quarter after he aggravated a left hamstring injury.
McCoy, ranked second in the NFL in rushing, had been questionable after hurting himself in practice Wednesday. He started, but totaled only 11 yards in eight carries before departing.
Landry led with his shoulder, launched into Williams and hit him high. Williams remained on his back for a couple of minutes before he slowly rose and was led to the locker room.
Landry was penalized earlier in the game for unsportsmanlike conduct for taunting.
Williams missed most of last season when he underwent neck surgery following an injury that threatened his career.
EDGE IN STATS: The Dolphins outgained Buffalo 454 yards to 267 and had a 14-minute edge in time of possession, but were hurt by 13 penalties for 116 yards. Two defensive stops by the Bills, who lead the NFL in red zone defense, forced field goals after long Miami drives.
AP NFL website: www.pro32.ap.org and http://twitter.com/AP-NFL
Follow Steven Wine on Twitter: http://twitter.com/Steve-Wine. His work can be found at http://bigstory.ap.org/content/steven-wine
NFL Week 3 betting nuggets: ATS, over/unders and trends
Here are notes and trends on each of this weekend's NFL games, including a prime-time Monday night matchup between the Eagles and Cowboys.
Houston Texans rookie quarterback Davis Mills throws TD
Anthony Miller's first touchdown reception with the Texans made the score 7-6 against the Panthers right before halftime.
Darnold keeps the rock for 5-yard TD
Sam Darnold fakes the handoff and runs into the end zone for a five-yard touchdown vs. the Texans.
Carolina Panthers' Christian McCaffrey injures hamstring, ruled out for game
Carolina Panthers running back Christian McCaffrey suffered a first-half hamstring injury and will not return to Thursday night's game against the Houston Texans.
Seattle Seahawks WR DK Metcalf vows to keep emotions in check, tune out opponents' smack talk
Seattle Seahawks WR DK Metcalf says he needs to do a better job of tuning out opponent smack talk and keeping his emotions in check.
New York Jets QB Zach Wilson aiming to be 'smart with the ball' against Denver Broncos
Jets QB Zach Wilson says he's focusing on improving his decision-making in situations where he needs to get rid of the ball heading into Week 3.