MIAMI GARDENS, Fla. (AP) — Matt Ryan fell asleep during Game 6 of the National League Championship Series, and wasn't even aware until waking up Sunday morning that the Atlanta Braves are heading to the World Series.

The Braves, he noted, are playing for a title despite struggling for much of the year.

And he sees no reason why such a turnaround can't inspire the Atlanta Falcons.

Ryan had two big throws to Kyle Pitts to get Atlanta into field-goal range on the final drive, Younghoe Koo made a 36-yarder as time expired, and the Falcons beat the Miami Dolphins 30-28 on Sunday — a sixth consecutive loss for Miami, and the second in a row coming on a final-play kick.

“You have the right mindset and have courage," Falcons coach Arthur Smith said of Ryan. “He has it. He’s a special player. I personally think he’s been criminally underrated his if you look at his career.”

Ryan passed for 336 yards, nearly half of them — 163 — going to Pitts, his rookie tight end. The Falcons had blown a 13-point fourth-quarter lead and were trailing with 2:27 left. But Ryan and Pitts needed only 37 seconds to flip the momentum.

A 23-yard pass to Pitts opened the final drive, a 28-yarder down the sideline got Atlanta well within Koo's range, and Ryan milked the clock down to almost nothing with Miami out of timeouts and resigned to simply hoping for a miracle miss.

“We had plenty of time," Ryan said. “We just needed a field goal. I know we have a guy who can put it between the pipes.”

Calvin Ridley and Russell Gage caught touchdown passes for the Falcons (3-3). Ryan completed 25 of 40 passes.

Tua Tagovailoa threw for 291 yards and a career-high four touchdowns, the last of them going to Mack Hollins with 2:27 left for Miami, which has dropped six straight. Tagovailoa completed 32 of 40 passes and had two interceptions — both of which led to Atlanta scores.

“The margin for error is slim in this league,” Tagovailoa said.

Mike Gesicki, Myles Gaskin and Isaiah Ford had the other touchdown receptions for Miami (1-6).

The Dolphins were down by six early in the fourth quarter when Xavien Howard stripped a catch from Ridley, then corralled the ball on his left hip for an interception as he fell to the turf. That gave Miami the ball on the Atlanta 32 and a chance to reclaim the lead.

But on Miami's ensuing play, Tagovailoa tried to force the ball to Jaylen Waddle. Falcons linebacker Foyesade Oluokun made an easy interception and returned the ball 56 yards to the Miami 14. Three plays later, Cordarrelle Patterson ran in from the 3, and the Falcons were up 27-14.

“It wasn't perfect,” Ryan said. “The idea is to get the job done, and we did that.”

Tagovailoa’s 7-yard pass to Gaskin made it a one-score game again, capping a 90-yard drive. After another Atlanta turnover midway through the fourth, Tagovailoa found Hollins to give the Dolphins the lead.

They just couldn’t hold it.

Miami led 7-0 early after Tagovailoa led a nearly perfect opening drive. The Falcons scored the next 20 points, aided by a bad interception from Tagovailoa on a pass into the end zone late in the half.

A three-play, 77-yard drive to open the second half was capped by a 49-yard touchdown pass from Ryan to Gage, and Patterson's TD run made it 27-14. Tagovailoa got Miami the lead, then had to watch Ryan take it away at the end.

“He put us in position to win the game, which at the end of the day is all you can ask for from the quarterback," Dolphins coach Brian Flores said.

INJURIES

Falcons: Ridley was shaken up in the third quarter after getting hit while trying to make a catch over the middle and getting sandwiched between two defenders. S Erik Harris left in the fourth quarter.

Dolphins: LB Jerome Baker (knee) and RB Malcolm Brown (quad) were lost in the first half with injuries. S Jason McCourty (foot) left in the second half.

CLOSE, AGAIN

For the second consecutive week, the Dolphins nearly got a turnover off a botched punt. Michael Palardy’s kick to Atlanta’s Olamide Zaccheaus late in the third quarter on Sunday hit the ground, then squirted toward the Falcons’ returner and came very close to brushing his lower body. Officials ruled the ball did not touch him, just as was the case last week on an eerily similar play in Miami’s loss to Jacksonville.

20 UNANSWERED

Atlanta’s 20 consecutive points — going from down 7-0 to up 20-7 — marked the fifth time in the last six games that Miami gave up at least that many points without scoring.

STARS WERE OUT

Tennis standout Coco Gauff, a South Florida resident, was at the game. So were several members of the undefeated Florida Panthers — including Jonathan Huberdeau, MacKenzie Weegar and Aaron Ekblad.

UP NEXT

Falcons: Host Carolina next Sunday, the same day Atlanta would host Game 5 of the World Series.

Dolphins: Visit Buffalo next Sunday, trying not to get beaten by the Bills for a seventh consecutive time.

___

More AP NFL coverage: https://apnews.com/hub/NFL and https://twitter.com/AP_NFL