BALTIMORE -- Playing on the road against a playoff-quality team, Philip Rivers would have been delighted with a win no matter how it occurred.
San Diego trailed the entire game until Rivers capped a 1-yard touchdown pass to Eddie Royal with 38 seconds to go, giving the Chargers a 34-33 victory.
The Chargers (8-4) trailed 30-20 with 6:13 remaining and 33-27 with 2:22 left before Rivers brought them back.
"These are the kind of games you got to win to get in (the postseason) and these are the kind of games you got to win if you do get in," Rivers said. "I'm not saying you're going to win all of them, but if you can't win these, you're not good enough."
Each team punted just once. Both offenses were clicking all day long, which made the outcome all that much sweeter for Rivers.
"Just the way we won. It was back and forth, back and forth, never quit," he said. "We got one more point than they had."
Following a pass interference call against Anthony Levine in the end zone, Rivers hit Royal to conclude an 80-yard drive and give the Chargers their third straight victory.
Rivers went 34 for 45 for 383 yards and three touchdowns, two to Keenan Allen.
"Tip our hat to the Chargers and Philip Rivers," Ravens coach John Harbaugh said. "Obviously, a great quarterback and that made the difference."
Baltimore (7-5) lost at home in November for the first time since 2009. The Ravens, who were 11-0 all-time at home against West Coast teams, fell 1½ games behind AFC North leader Cincinnati.
The defense accepted the blame, even though it forced two turnovers.
"In the NFL, nothing is game, set, match as long as there is time on the clock," linebacker Terrell Suggs said. "We're up 10 at home in the fourth quarter and our offense gave us 33 points and usually that's enough. It wasn't. That's why this is extremely disappointing."
The Ravens last lost a game when they scored 30 points in October 2009, a 33-31 defeat at Minnesota. The last time it happened at home was in 2007, 33-30 in overtime against Cleveland.
It was 23-20 before Flacco directed a 12-play drive that seemingly provided the Ravens with some breathing room. A 31-yard completion to Jacoby Jones, followed by a pass interference call against Shareece Wright, led to the third-down quarterback sneak that made it a 10-point game.
Rivers responded with a 77-yard drive, capped by a 23-yard touchdown pass to Allen with 3:40 remaining.
Jones took the kickoff 72 yards to the San Diego 30, setting up Tucker's fourth field goal. It wasn't enough for the Ravens, who hadn't lost at home since the season opener.
San Diego, on the other hand, got off to an excellent start in a season-ending stretch drive that began in Baltimore and concludes with games against New England, Denver, San Francisco and Kansas City.
"The players never gave up and we just kept plugging away," coach Mike McCoy said. "That's what good teams do. The character of our team once again showed up, and when you've got a great quarterback like Philip Rivers, you got a chance to win every game just as long as there's time left on the clock."
On the ensuing drive, Flacco misfired from the San Diego 39. But Eric Weddle inexplicably pushed Flacco to the ground, drawing a roughing-the-passer penalty. Five plays later, Flacco connected with Torrey Smith on a 10-yard pass for a 23-13 lead.
San Diego's only punt came with two minutes left in the third quarter. The Ravens' lone punt occurred with 23 seconds to go in the period.
The Chargers converted all seven third-down tries in the first half, but Baltimore took advantage of two turnovers and scored on all four of its possessions for a 16-10 lead.
Forsett went over 1,000 yards for the first time in his seven-year career. He's at 1,009. ... Baltimore WR Marlon Brown landed hard on his back after making a first-down catch in the first quarter and left with a concussion. ... Chargers C Chris Watt took a hit on his calf in the third quarter and did not return.
Jets' offense under Adam Gase: Not so sneaky (and not so good, either)
In 15 games under the Jets' coach, third-year quarterback Sam Darnold has never attempted a rush on a third-and-1 or fourth-and-1. What gives?
Sony Michel's grip on Patriots' top RB spot could be slipping away
Coming off a disappointing game in Week 2 and with the return of Damien Harris imminent, the pressure is on New England's third-year back to perform.
Will the Vikings offense be able to keep up with Tennessee's scoring pace?
The Titans are seeking their first 3-0 start since 2008, while the Vikings are trying to avoid their first 0-3 start since 2013.
Both Watt brothers could have productive day in Texans-Steelers
T.J. Watt and the Steelers will try to continue their unbeaten start as they host J.J. Watt and the winless Texans.
Can Broncos muster the pass rush needed to stop Bucs' Tom Brady?
Brady could be extra motivated to beat the Broncos, the only team he does not have a winning record against in his career.
Falcons' offense might have field day vs. underperforming Bears D
Atlanta's defense hasn't been able to stop much, but Chicago's inconsistent QB Mitch Trubisky might be what the Falcons needed.