– One big comeback, then another.

And now another game for Tom Brady and the New England Patriots.

The quarterback who treats deficits as distractions dug the Patriots out of two 14-point holes — the first team to do that in NFL playoff history — to reach the AFC Championship Game for the fourth consecutive year with a 35-31 victory over the Baltimore Ravens on Saturday.

"Behind twice by 14 wasn't necessarily in the plan," Brady said. "It took a lot of execution to overcome it."

Thanks to three touchdown passes by Brady and one by college quarterback turned receiver Julian Edelman, the resilient Patriots kept their season alive.

"Right now, it's all about giving us a chance to come to work again," said safety Devin McCourty, who batted down Joe Flacco's desperation pass into the end zone on the last play.

Brady led a masterful march — completing eight of nine passes and running for a first down — to the decisive 23-yard touchdown completion to Brandon LaFell with just more than five minutes left to give the Patriots their first lead.

The top-seeded Patriots (13-4) will host the winner of Sunday's Indianapolis-Denver game in the AFC title game. The sixth-seeded Ravens (11-7) had won two of three playoff games in Foxborough over the past five seasons.

"We came to their home field and fought them to the end, and we just came up short," said Kamar Aiken, who caught one of Flacco's four touchdown passes.

Brady completed 33 of 50 passes for 367 yards for an offense that picked up only 14 yards on the ground, the second fewest in team playoff history. His 46 career playoff touchdown passes surpassed Joe Montana's 45 for most in NFL history.

Flacco was 28-for-45 for 292 yards with two interceptions. Justin Forsett gained 129 yards on 24 carries.

It was a thrilling game of shifting momentum — two touchdowns by the Ravens, the next two by the Patriots, two more by the Ravens and another two by the Patriots.

"We had two separate 14-point leads. Those guys did a good job getting it back to seven as quickly as they could," Flacco said. "They don't panic."

Flacco completed his first eight passes, two for TDs of 19 yards to Aiken and 9 yards to Steve Smith, to give the Ravens a 14-0 lead. Then the Patriots tied it on a 4-yard run by Brady and his 15-yard pass to Danny Amendola late in the first half.

Flacco capitalized on a Brady interception with an 11-yard scoring pass to Owen Daniels with 10 seconds left for a 21-14 halftime lead.

Flacco's fourth TD pass made it 28-14 early in the third.

Then fortunes turned again.

Brady threw a 5-yard TDs pass to Rob Gronkowski, and the Patriots got the ball back after a punt. This time, another strong arm lifted the Patriots into a tie.

With the ball at the New England 49, Brady threw behind the line of scrimmage to Edelman on the left side. The former Kent State quarterback then lofted a deep pass to a wide-open Amendola.

"We've had it in for 10 weeks, and the coaches finally got to call it," Edelman said. "I had to loosen up the arm a little bit."

After Justin Tucker's 25-yard field goal gave the Ravens a 31-28 lead, Brady hit LaFell with the go-ahead TD pass.

"It was a wild game," Patriots coach Bill Belichick said, "but I'm just thankful our players hung in there and made the plays they needed to make."