Foxboro, MA (SportsNetwork.com) - Baltimore Ravens head coach John Harbaugh called Joe Flacco the NFL's best quarterback last week.

Tom Brady had something to say about that this week.

Brady's 367 yards and three touchdowns, the last a go-ahead 23-yard strike to Brandon LaFell with 5;13 remaining, rallied the New England Patriots to a 35-31 AFC Divisional Playoff victory over Harbaugh's Ravens at Gillette Stadium.

The fourth postseason meeting between the teams in six years was another classic, with the Patriots twice battling back from 14 points down -- including a 28-14 deficit midway through the third quarter -- and not taking their first lead until Brady's final TD delivery of the day.

New England also overcome a career postseason-best four touchdown throws from Flacco, though his second interception of the game virtually ended Baltimore's own comeback hopes with 1:39 left to play.

"Hats off to our team. They worked hard this week," said Patriots head coach Bill Belichick. "It certainly wasn't our best game -- we'll need to play a lot better next week, whoever we play -- but it's good to win."

The top-seeded Patriots advanced to their fourth straight AFC Championship Game, where they'll await the winner of Sunday's Indianapolis-Denver clash.

Brady's yardage total and 33 completions in 50 attempts each shattered his own franchise records for a playoff game, while the three-time Super Bowl champ's connection with LaFell gave him 46 career postseason touchdown passes to break the league's all-time record held by Brady's boyhood idol, Joe Montana. He also ran for a touchdown.

"He's a pretty good quarterback," Ravens linebacker Terrell Suggs said of Brady. "He sat in there and made the plays they needed him to make."

Rob Gronkowski caught one of Brady's touchdown throws in a 7-reception, 108- yard effort. Danny Amendola finished with a pair of touchdown grabs for New England, including a 51-yard catch from wide receiver Julian Edelman on a trick play in the third quarter.

Flacco, aiming to extend his own NFL record with an eighth career playoff win on the road, ended with 292 yards on a 28-of-45 completion rate. Justin Forsett had a touchdown catch while running for 129 yards on 24 carries for Baltimore, which owns two of the three victories by visiting teams against New England in the Brady/Belichick era and very nearly pulled off a third.

The Ravens owned a 31-28 lead following Justin Tucker's 25-yard field goal with 10:17 remaining, before Brady sent New England ahead with a terrific performance on the ensuing drive.

He completed 8-of-9 attempts while marching the Patriots 74 yards in 10 plays, with Amendola coming up with a key 6-yard catch on 3rd-and-6 to move the chains at the Baltimore 38.

Three snaps later, Brady launched a perfect downfield throw that LaFell cradled down the left sideline for the go-ahead -- and record-setting -- score.

Flacco's 17-yard hookup with Owen Daniels on 4th-and-3 had the Ravens in New England territory at the two-minute warning, but he overthrew Torrey Smith on a deep route and New England's Duron Harmon picked off the pass in the end zone to just about seal the outcome.

The Ravens did get back the ball near midfield with four seconds left. However, Flacco's Hail Mary heave into the end zone was knocked away as time expired.

"You've got to give credit to (New England)," said Flacco. "They don't panic, they just play the game and keep at it. They got themselves back in the game, we pulled away, (then) they were in striking distance and they made the play."

Flacco's fourth touchdown toss of the afternoon, a 16-yarder to Forsett, staked Baltimore to a 28-14 advantage early in the third quarter. The battle- tested Pats were undaunted, however, as Brady engineered touchdowns on the next two possessions.

After 9-play, 80-yard sequence in which Brady threw on every down resulted in Gronkowski's 5-yard touchdown catch, New England wasted little time striking again after its defense induced a three-and-out.

Brady initially looked downfield before tossing the ball behind the line of scrimmage to Edelman, who hit an uncovered Amendola in stride to draw the Patriots even with 4:20 to go in the third quarter.

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

A sack of Flacco and fumble recovery by Jamie Collins deep in the Ravens' own end on the following series was negated by a defensive holding call on Darrelle Revis, and Baltimore capitalized on the penalty. The Ravens moved into scoring range behind several strong runs from Forsett, though they ended up settling for Tucker's field goal when Daniels couldn't come down with Flacco's third-down pass in the end zone.

Flacco was right on the mark during Baltimore's first two drives of the game, both of which resulted in touchdowns to stake the Ravens to a 14-0 lead.

He went 4-for-4 for 69 yards on the opening series as Baltimore reached the end zone in just five plays, the last a 19-yard catch by Kamar Aiken on a well-executed play fake by Flacco that began the scoring just 2:42 in.

Flacco hit on 5-of-6 throws to complement a pair of long runs from Forsett on the Ravens' next possession, which ended when Steve Smith beat Revis to make a juggling 9-yard touchdown catch on 3rd-and-7.

Two big plays from Gronkowski, a 16-yard reception on 3rd-and-8 and a 46-yard connection with Brady, helped New England close the gap on the following drive. Brady cut the lead to 14-7 by scrambling into the end zone from four yards out on a 3rd-and-goal play in the final minute of the first quarter.

The Patriots converted two more third downs on Brady completions, one a 23- yard strike to Gronkowski, on a game-tying 10-play trek late in the second quarter. Amendola capped it by shaking free of a tackle on a short catch and diving across the goal line for a 15-yard touchdown 3:37 before halftime.

Brady's lone critical mistake of the day came on New England's next offensive set, as he failed to recognize Daryl Smith in underneath coverage and the veteran linebacker intercepted the intended pass for Gronkowski at the Ravens' 43.

After a 20-yard pass interference penalty on Revis put the Ravens deep into New England territory, Daniels came down with Flacco's pinpoint back-shoulder throw into a tight window for an 11-yard touchdown that sent Baltimore into the half up 21-14.

A gutsy 4th-and-6 call on its initial series of the second half enabled Baltimore to extend the lead, as Torrey Smith hauled in Flacco's deep pass while being mugged by Brandon Browner at the Patriots' 1-yard line. Though the wideout's taunting penalty pushed the ball back 15 yards, Flacco found a wide- open Forsett in the flat on the ensuing snap to restore the 14-point differential.

Game Notes

The win was the 20th for Belichick in the postseason, tying him with Dallas Cowboys legend Tom Landry for the most by a head coach in league history ... In addition to breaking Montana's mark, Brady became the NFL's all-time leader in postseason passing yards with 6,791 ... Brady posted his seventh career 300-yard passing game in the playoffs, second only to Peyton Manning in NFL history ... Flacco had gone 188 straight pass attempts without an interception before being picked by Devin McCourty in the third quarter ... Edelman had eight catches for 74 yards, with Amendola totaling 81 yards on five receptions ... Patriots rookie center Bryan Stork did not return after injuring his right knee.