BALTIMORE - Playing on the road against a playoff-quality team, Philip Rivers would have been delighted with a win no matter how it occurred.

The manner in which the San Diego Chargers beat the Baltimore Ravens yesterday, well, it doesn't get much better than that for a veteran quarterback looking to carry his team into the playoffs.

San Diego trailed the entire game until Rivers tossed 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 1/2 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.

Joe Flacco threw for two scores for Baltimore, which wasted four field goals from Justin Tucker and 106 yards rushing from Justin Forsett.