ATLANTA (AP) — The Atlanta Falcons were in position to force overtime.

Matt Ryan went for the win.

He wound up with a second straight loss.

The reigning MVP threw his sixth interception in the past three games, this one with just 39 seconds remaining, to finish off a stunning 20-17 loss to the Miami Dolphins on Sunday.

The Falcons squandered a 17-0 halftime lead, sparking memories of their epic Super Bowl meltdown .

"Just a pretty inconsistent game for us," Ryan said.

(AP Photo/David Goldman)

After the Dolphins went ahead for the first time all game on Cody Parkey's 38-yard field goal with 2½ minutes remaining, Ryan completed five passes for 61 yards to take the Falcons to the Miami 26.

That was well within the range of Matt Bryant, who has already kicked a 50-yarder.

"I understood we were in field goal range to tie the game," Ryan said. "I also understood that we had plenty of time on the clock."

Ryan looked to hit tight end Austin Hooper on a slant down the middle. The pass was on target, but cornerback Cordrea Tankersley got a hand on the ball. It deflected into the arms of safety Reshad Jones for the interception.

Game over.

"It was a throw that I felt good about," Ryan said. "I let it rip. Just a good play by them. Sometimes, that's how it goes."

The Falcons (3-2) had plenty of chances to avoid a gut-wrenching loss.

After Miami cut the deficit to 17-7 with an impressive drive to start the second half, the Falcons went three-and-out — the possession in trouble right from the start when Ryan was sacked on first down.

The Dolphins wound up with excellent field position at their 49 when Matt Bosher's punt went only 26 yards.

The Dolphins drove to the Atlanta 23, where Jay Cutler's pass was picked off by Deion Jones. But the play was nullified by a silly roughing-the-quarterback penalty on Grady Jarrett. Cutler capitalized with a 7-yard touchdown pass to Jarvis Landry.

Just like that, it was 17-14.

The Falcons had an opportunity to extend the lead when Ryan's 18-yard pass to Julio Jones set up a first down at the Miami 33. But a holding penalty on Jake Matthews and another sack of Ryan ruined that drive, bringing Bosher back on the field.

That's when Atlanta made another huge mistake.

The snap was botched — it may have grazed the up-back, but no one was really quite sure — and Bosher had to pick up the bouncing ball and attempt to run. He was dropped just beyond midfield, setting up the Dolphins to drive for a tying field goal.

In the end, Ryan's pick ensured the Falcons of another home defeat after starting the season 3-0.

"I thought we did a nice job of executing to get ourselves down into that situation," Ryan said.

"I felt like I made the right read in that situation, put it where I wanted to, and that's how the game goes sometimes.

"I'm disappointed with it, but we're going to continue to battle, and I think we'll be better for it and hopefully more mentally and physically tough as a football team moving forward."

(Curtis Compton/Atlanta Journal-Constitution via AP)

Vic Beasley Jr., who returned to the Falcons' defense after missing two games with a hamstring injury, couldn't help but remember what happened in the final game of last season.

Atlanta led the New England Patriots 28-3 in the second half of the Super Bowl, only to lose in overtime after a historic comeback led by Tom Bready.

"It's tough," Beasley said. "We experienced that feeling before in the Super Bowl."

And they'll be reminded of it all through the coming week. Next up for the Falcons: a primetime rematch against the Patriots next Sunday night in Foxborough.

Safety Ricardo Allen said it's time to do some soul-searching.

"We're a really good team, but we have to be ready to fight," he said. "At the end of the game when it's 17-14, we were flat. We were winning. That's what I don't understand."

The Falcons have been outscored 72-40 in the second half this season, which is becoming a disturbing trend.

"We've got to keep grinding," Allen said. "We've got to learn how to bounce back from that stuff."

___

Follow Paul Newberry on Twitter at www.twitter.com/pnewberry1963 . His work can be found at https://apnews.com/search/paul%20newberry

___

For more AP NFL coverage: www.pro32.ap.org and www.twitter.com/AP_NFL