Sept. 8 (UPI) -- Josh Allen threw for 251 yards in the fourth quarter to help the Buffalo Bills overcome a 15-point deficit and stun the Baltimore Ravens in their season opener.

The reigning NFL MVP totaled 394 passing yards and two scores, in addition to 30 yards and two scores on the ground, in the 41-40 victory Sunday in Orchard Park, N.Y. The Bills trailed 40-25 with less than five minutes remaining before closing out the game with 16 unanswered points.

"We were fortunate to win it," Bills coach Sean McDermott told reporters. "Maybe we'll see them again at some point."

The Bills out-gained the Ravens 497-432 in total yards. They held a 29-19 advantage in first downs and an edge of more than nine minutes in time of possession. The Ravens out-gained the Bills 238-108 on the ground.

"It took everybody there," Allen said. "I'm just proud of our team for staying in it. No one on the sideline blinked, down 15 points with five or six minutes left."