DENVER – No matter where his season or his career might end, Joe Flacco will always have The Fling.

And because he does, the New England Patriots don’t have to be concerned about going on the road in the playoffs.

If New England can defeat the Houston Texans on Sunday, they will be home for the AFC championship game against Baltimore next Sunday, with a spot in the Super Bowl on the line.

Flacco’s desperation 70-yard touchdown pass to Jacoby Jones with 31 seconds left in regulation saved the game for Baltimore, and Peyton Manning’s throw across his body in overtime all but lost it for Denver.

On a frostbitten day on the frozen tundra known as Denver, the Ravens got a 47-yard field goal from Justin Tucker 1:42 into the second overtime Saturday to pull off a 38-35 upset over Manning and the Broncos, extending linebacker Ray Lewis’ career by at least one game.

“Our team is so confident and everything went against us,” Lewis said, “but we found a way to come here together and we’re leaving together. It’s just awesome.”

Lewis, who led the Ravens with 17 tackles over this nearly 77-minute game, kneeled and put his helmet on the rock-solid turf when it was over.

After Lewis thaws out, the Ravens (12-6), 9.5-point underdogs for this one, will get ready for a game at New England or Houston.

This game, the longest since the Browns beat the New York Jets 23-20 in 1987, was an all-timer — up there with San Diego’s 41-38 double-overtime victory over Miami for drama. But Flacco’s throw might best be bookended next to one made by Roger Staubach, who famously coined the term “Hail Mary” after his game-winning toss to Drew Pearson beat Minnesota in the 1975 playoffs.

How to describe the Flacco Fling?

On third-and-3 from his 30 with 41 seconds and no timeouts left, Flacco bought time in the pocket and saw Jones sprinting down the right sideline into double coverage. Defensive back Tony Carter slowed up and let Jones streak by him. Instead of staying step for step with Jones, safety Rahim Moore tried to leap and knock down the ball. Flacco, who throws the high, deep ball as well as anyone, got it over Moore’s head and into Jones’ hands.

“At that point you have to start taking shots,” Flacco said. “You have to get a little lucky.”

Jones caught it and pranced into the end zone, blowing kisses to the crowd. Moore was on the verge of tears after the game.

“The loss, it was my fault,” Moore said. “I got a little too happy. It was pathetic.”

The teams punted three times to start overtime, setting up Denver on its 7. Manning was moving the Broncos along slowly and steadily. But on second-and-6 from the 38, he rolled to his right, stopped and threw across the field to Brandon Stokley. Graham stepped in front of the receiver for the interception, bookending the pick he made in the first quarter, which he returned 39 yards for a touchdown and a 14-7 lead.

The temperature at kickoff was 13 degrees, and Manning fell to 0-4 lifetime when the temperature is 40 or less. He finished 28 of 43 for 290 yards and accounted for all three Denver turnovers — the two picks and a lost fumble that set up the touchdown that tied the game at 28 late in the third quarter.

But the last throw was the worst.

“Not a good decision,” Manning said. “Not a great throw, either.”

Those mistakes nullified a record-setting day for returner Trindon Holliday, who returned a punt 90 yards for a touchdown and a kickoff 104 yards for another score. Both were playoff records for longest returns, as was the 248 total return yards he had.

This was the unthinkable for the Broncos (13-4), who came in on an 11-game win streak and the odds-on favorite at 3-1 to win the Super Bowl, in Manning’s hometown of New Orleans.

Instead this loss goes down with the most devastating in Denver history. Right there with the 30-27 loss to the Jacksonville Jaguars on Jan. 4, 1997, another year when Denver looked like Super Bowl material.

But it’s Baltimore and Lewis who are in the AFC title game for the second straight year.

Last year, Billy Cundiff missed a 32-yard field goal against New England that would have tied that game at the end of regulation.

This year the Ravens had Tucker, and though the temperature was cold and the ball was hard, Coach John Harbaugh showed zero desire to get the ball closer after Ray Rice ran for 11 yards to the Denver 34 near the end of the first overtime.

Tucker finished the day 1 of 1. Broncos kicker Matt Prater missed his only try, from 52 yards, at the end of the first half. Broncos Coach John Fox will be second-guessed about the decision to go for the long kick, especially considering the way Flacco responded: throwing and completing three straight passes after the miss for a 58-yard touchdown drive that tied the game at 21 at halftime.

The touchdown was a 32-yard connection to Torrey Smith, marking the second time Smith beat Broncos cornerback Champ Bailey.