Joe Webb's short pass to running back Brandon Wegher led to a 42-yard touchdown with 54 seconds left in rallying the Carolina Panthers to a 25-24 win over the Buffalo Bills in each team's preseason opener on Friday night.
The Panthers' third-string quarterback then hit Paul Browning for a 2-point conversion to seal the victory, as coach Ron Rivera went for the win rather than have the game decided in overtime.
The loss spoiled new Bills coach Rex Ryan's first game at Ralph Wilson Stadium. Fired by the New York Jets at the end of last season, he was hired by Buffalo to replace Doug Marrone, who stepped down abruptly on Dec. 31.
More from FoxSports
The Bills were in a position to win after EJ Manuel put them ahead 24-17 by hitting receiver Deonte Thompson in stride for a 51-yard touchdown late in the third quarter.
The game was decided with Webb facing second-and-2 at the Bills 42. Faking a pass to his right, he caught Buffalo's defense leaning the wrong way. He then dumped a short pass off to Wegher, who had a clear path to the end zone up the left sideline.
Panthers starter Cam Newton went 5 of 10 for 83 yards, including a 2-yard touchdown pass to Kelvin Benjamin to cap the starting offense's third and final series. Carolina backup Derek Anderson hit Brenton Bersin for a 12-yard touchdown pass in the back of the end zone on the first drive of the second half.
Benjamin finished with three catches for 36 yards, and Ted Ginn Jr. -- back in Carolina for a second stint -- had a 38-yard catch up the right sideline.
For Buffalo, Bryce Brown scored on a 4-yard run, and rookie Karlos Williams scored on a 1-yarder. The two scoring drives came with Tyrod Taylor at quarterback.
All three Buffalo quarterbacks competing for the starting job had solid outings.
Veteran Matt Cassel started and was efficient in completing 7 of 8 for 45 yards in two series. His only incompletion was a short pass dropped by Chris Hogan.
Taylor, who spent the previous four seasons as Joe Flacco's backup in Baltimore, displayed his dual-threat ability. He completed 5 of 8 attempts for 49 yards, and also had six carries for 47 yards in playing three series.
Manuel finished 4 of 8 for 77 yards over five series in the second half.
Linebacker Ikemefuna Enemkpali made his Bills' debut, three days after being released by the New York Jets for a sucker punch that broke the jaw of starting quarterback Geno Smith. Enemkpali was claimed by Buffalo on Wednesday, and entered the game with the second stringers.
He finished with two tackles, including one for a loss. Enemkpali was also penalized for being offside on a Panthers' drive that ended with Graham Gano cutting Buffalo's lead to 14-10 by hitting a 47-yard field goal with 1 second left in the first half.