ORCHARD PARK, N.Y. -- Sam Bradford threw a 13-yard touchdown pass to Brandon Gibson with 48 seconds remaining as the St. Louis Rams nipped the Buffalo Bills 15-12 at soggy Ralph Wilson Stadium.
The Rams, who won three straight for the first time in six seasons, improved to 6-6-1 and kept alive their playoff hopes. The Bills dropped to 5-8 and are almost assured of missing the playoffs for a 13th straight season.
Bradford completed 19 of 39 passes for 209 yards and one score.
Defenses dominated on this day as the teams combined for 15 punts and just two touchdowns.
The Bills took a 3-0 lead near the end of the first quarter on a 35-yard field goal by Rian Lindell. The kick capped 10-play, 56-yard drive and included a 15-yard screen pass from Ryan Fitzpatrick to C.J. Spiller and a 15-yard pass to tight end Scott Chandler.
Buffalo was driving for another score on its next series, but the march ended when Rams safety Quintin Mikell punched the ball out of Fred Jackson's hands and linebacker James Laurinaitis recovered at the St. Louis 19.
The Bills increased their lead to 6-0 near the end of the of the half on Lindell's 40-yard field goal. The score was set up when cornerback Stephon Gilmore intercepted Sam Bradford's pass. He returned the pick to the end zone, but the touchdown was nullified when Kyle Moore was called for defensive holding on the return.
St. Louis took the lead midway through the third quarter on a 1-yard run by Steven Jackson. Bradford, who completed just 5-of-13 for 37 yards in the first half, was 5-of-6 for 56 yards on the drive.
Buffalo went up 12-7 on its next possession with a 9-play, 75-yard drive that ended with a two-yard touchdown pass from Fitzpatrick to tight end Lee Smith. The extra point failed when the snap slipped through the hands of holder Shawn Powell.
The Rams came back to win the game with a 14-play, 84 yard drive with just under five minutes remaining. St. Louis won it on Bradford's pass to Gibson (six catches for 100 yards) with 48 seconds to go. Bradford capped the scoring when he also hit Gibson for a two-point conversion.
NOTES: Bills defensive end Mario Williams picked up sixth sack in the past four games and surpassed the double-digit mark for the third time in his 7-year NFL career. His 10.5 sacks are the most by a Bill in six seasons. ... Rams punter Johnny Hekker was credited with a punt for zero yards early in the fourth quarter. The snap sailed through his hands and he had to retrieve it and kick on the run while being pressured. The play gave the Bills the ball on their 49. ... Injuries to center Eric Wood and right tackle Chris Hairston forced the Bills to use two offensive linemen who had never started an NFL game -- David Snow and Sam Young. ... Rams receiver/returner Danny Amendola missed his second straight game with a heel injury. .... St. Louis won for the first time in four games this season against AFC East opponents.