Tom Brady's third touchdown pass gave New England its first lead with about five minutes remaining and the Patriots reached their fourth straight AFC championship game with a 35-31 win over the Baltimore Ravens on Saturday.

Justin Tucker had given the Ravens a 31-28 lead on a 25-yard field goal with 10:17 left. Then Brady directed a masterful 74-yard drive. He completed eight of nine passes for 72 yards -- and ran for a first down -- and put the Patriots ahead with a 23-yard touchdown pass to Brandon LaFell.

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

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.

Joe Flacco completed his first eight passes, two for touchdowns of 19 yards to Kamar 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.

The Patriots were driving again -- until Daryl Smith intercepted Brady's pass and Flacco capitalized with an 11-yard scoring pass to Owen Daniels with 10 seconds left for a 21-14 halftime lead.

And when New England punted on the first series of the third quarter, Baltimore added to its lead on Flacco's fourth scoring pass, a 16-yarder to Justin Forsett, who was wide open in the flat and scored easily.

Then fortunes turned again.

Brady threw a 5-yard touchdown 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 Julian Edelman on the left side. The former college quarterback at Kent State then lofted a deep pass to a wide-open Amendola after a defender came up toward Edelman. It was the first postseason pass by a wide receiver since Pittsburgh's Antwaan Randle-El threw one in the 2006 Super Bowl.

After Tucker's go-ahead field goal, the Ravens nearly stopped the Patriots drive. Brady threw a 9-yard completion to Shane Vereen and officials ruled he fumbled and Baltimore recovered. The call was reversed when replays showed Vereen was down by contact. Seven plays later, LaFell scored.

Baltimore had two more possessions. The first ended when Duron Harmon intercepted Flacco's deep pass in the end zone with 1:39 left. On the final series, Flacco's desperation pass into the end zone was knocked down as time expired.

Brady completed 33 of 50 passes for 367 yards, while Flacco was 28 for 44 for 292 yards and two interceptions.