Josh Allen completed a 3-yard touchdown pass to tight Tyler Kroft with 15 seconds remaining, and the Buffalo Bills survived to beat the Los Angeles Rams 35-32 after squandering a 25-point lead on Sunday.

The Rams (2-1) were poised to match the third-largest comeback in NFL regular season history after Jared Goff led the team to touchdowns on four straight drives, capped by Darrell Henderson's 1-yard run with 4:30 remaining.

More Images
Buffalo Bills' Tyler Kroft (81) catches a pass for the game winning touchdown in front of Los Angeles Rams' Micah Kiser (59) during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. The Bills won 35-32. (AP PhotoAdrian Kraus)

Josh Allen completed a 3-yard touchdown pass to tight Tyler Kroft with 15 seconds remaining, and the Buffalo Bills survived to beat the Los Angeles Rams 35-32 after squandering a 25-point lead on Sunday.

Buffalo Bills tight end Tyler Kroft (81) catches a pass in front of Los Angeles Rams' Troy Hill (22) and John Johnson (43) during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoAdrian Kraus)

One play later, Allen rolled to his left and lobbed a pass over a Rams defender. Kroft made a leaping catch and secured the ball before tumbling to the ground, his second TD of the game. He earned additional playing time with starter Dawson Knox sidelined by a concussion.

Los Angeles Rams' Robert Woods, left, is tackled b Buffalo Bills' Tremaine Edmunds, right, during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoAdrian Kraus)

Buffalo has won its first three games in consecutive seasons, the first time the franchise has done that since 1991-92 and the third time overall.

Los Angeles Rams' Darrell Henderson, left, breaks a tackle by Buffalo Bills' Tremaine Edmunds, right, to score a touchdown during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Los Angeles Rams' Darrell Henderson, left, breaks a tackle by Buffalo Bills' Tremaine Edmunds, right, to score a touchdown during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Los Angeles Rams tight end Tyler Higbee, left, catches a pass in front of Buffalo Bills' Jaquan Johnson, right, to score on the point after try during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Los Angeles Rams tight end Tyler Higbee, left, catches a pass in front of Buffalo Bills' Jaquan Johnson, right, to score on the point after try during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Allen responded by marching the Bills (3-0) on an 11-play, 75-yard drive, which was extended by a pass interference penalty against Darious Williams on fourth-and-7 from the Rams 12. Williams interfered with intended receiver Gabriel Davis at the 3.

Buffalo Bills' Tyler Kroft (81) catches a pass for the game winning touchdown in front of Los Angeles Rams' Micah Kiser (59) during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. The Bills won 35-32. (AP PhotoAdrian Kraus)

Buffalo Bills' Tyler Kroft (81) catches a pass for the game winning touchdown in front of Los Angeles Rams' Micah Kiser (59) during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. The Bills won 35-32. (AP PhotoAdrian Kraus)

One play later, Allen rolled to his left and lobbed a pass over a Rams defender. Kroft made a leaping catch and secured the ball before tumbling to the ground, his second TD of the game. He earned additional playing time with starter Dawson Knox sidelined by a concussion.

Allen finished with four touchdown passes and scored on a 1-yard run. The third-year starter, however, contributed to the Rams' comeback bid, with an interception and a lost fumble leading to Los Angeles touchdown drives.

Allen now has had a hand in 12 touchdowns, the most in team history through the first three games of the season. Hall of Famer Jim Kelly held the record of 10, set in 1991.

Buffalo Bills tight end Tyler Kroft (81) catches a pass in front of Los Angeles Rams' Troy Hill (22) and John Johnson (43) during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoAdrian Kraus)

Buffalo Bills tight end Tyler Kroft (81) catches a pass in front of Los Angeles Rams' Troy Hill (22) and John Johnson (43) during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoAdrian Kraus)

Buffalo has won its first three games in consecutive seasons, the first time the franchise has done that since 1991-92 and the third time overall.

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP_NFL

Los Angeles Rams' Robert Woods, left, is tackled b Buffalo Bills' Tremaine Edmunds, right, during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoAdrian Kraus)

Los Angeles Rams' Robert Woods, left, is tackled b Buffalo Bills' Tremaine Edmunds, right, during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoAdrian Kraus)

Los Angeles Rams' Darrell Henderson, left, breaks a tackle by Buffalo Bills' Tremaine Edmunds, right, to score a touchdown during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Los Angeles Rams' Darrell Henderson, left, breaks a tackle by Buffalo Bills' Tremaine Edmunds, right, to score a touchdown during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Los Angeles Rams tight end Tyler Higbee, left, catches a pass in front of Buffalo Bills' Jaquan Johnson, right, to score on the point after try during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)

Los Angeles Rams tight end Tyler Higbee, left, catches a pass in front of Buffalo Bills' Jaquan Johnson, right, to score on the point after try during the second half of an NFL football game Sunday, Aug. 26, 2018, in Orchard Park, N.Y. (AP PhotoJohn Munson)