BALTIMORE (AP) — As usual, the Ravens got themselves involved in a close finish. For a change, Baltimore found a way to win.

Justin Tucker kicked a 39-yard field goal on the final play to give the Ravens a 29-26 victory over the San Diego Chargers on Sunday.

READ MORE: Ticketholders To Filipino Festival FAHMfest Find Empty Parking Lot In San Pedro

Joe Flacco threw for 319 yards and ran for a score to help Baltimore (2-6) snap a three-game skid and hand the Chargers (2-6) their fourth straight defeat.

The Ravens’ six losses this season have come by a combined 30 points, and their only win before Sunday came in overtime.

Tucker’s fifth field goal came three plays after a third-down pass interference call against Steve Williams moved the ball 21 yards to the San Diego 22.

The victory came at a price: Receiver Steve Smith tore his right Achilles tendon in the third quarter and is lost for the season. After being tackled at the end of an 18-yard gain, the 36-year-old Smith had to be helped off the field and could not put any weight on his right leg.

Now in his 15th NFL season, Smith has said he will retire after this year. He had five catches for 82 yards before the injury.

San Diego’s Philip Rivers threw three touchdown passes and went 28 for 37 for 301 yards, his franchise-record fifth consecutive 300-yard game. Two of his touchdown passes went to Malcom Floyd, including a 70-yarder.

Baltimore went ahead 26-23 with 4:34 to go when Flacco scored on a quarterback sneak to end a concise 38-yard drive that followed a 17-yard punt return by Jeremy Ross.

Rivers began the ensuing drive with a 26-yard pass to Danny Woodhead, and the Chargers pulled even on a 49-yard field goal from Josh Lambo with 2:07 remaining.

But the Ravens answered. One week earlier, and in the opener at Denver, Baltimore came up short with a chance to win in the waning minutes.

READ MORE: Lakers Lose To Warriors 121-114

In a back-and-forth game, San Diego went up 23-16 in the third quarter when Rivers beat a blitz to connect with Floyd on that 70-yard score. Rivers threw the pass an instant before getting tackled by free safety Kendrick Lewis, who vacated his usual spot deep in coverage to pursue the quarterback.

It was Rivers’ longest completion since 2012 and the longest of Floyd’s career.

Baltimore responded with Tucker’s fourth field goal, a 45-yarder on the final play of the quarter.

Rivers completed 19 of 22 passes in the first half. His second touchdown pass provided the Chargers with a 16-13 lead at the break.

Tucker sandwiched a pair of field goals around one by Lambo for a 6-3 lead after the first quarter. Tucker’s second kick followed a 46-yard completion to Smith, who essentially grabbed a jump ball in front of Jason Verrett.

The rest of the half featured a trio of 80-yard drives, two by the Chargers.

Rivers made it 10-6 with a 9-yard pass to Floyd before Flacco put Baltimore back in front with a 3-yard throw to Crockett Gillmore. The 11-play march featured a 36-yard completion to Chris Givens and a fourth-and-1 conversion from the San Diego 23.

Rivers finished with a 13-yard TD pass to Keenan Allen, who made a sensational catch in the corner of the end zone with 9 seconds remaining in the half. The conversion, however, was blocked.

Baltimore got a field goal on its opening drive of the second half to knot the score at 16.

MORE NEWS: One Shot In Beverly Hills Robbery Outside Restaurant

(© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)