SAN FRANCISCO (AP) — The San Francisco 49ers have ended a six-year playoff drought even though they lost to the Atlanta Falcons 29-22 in a wild finish in which they allowed 12 points in the final two seconds.

That’s right, 12 points in the last two seconds.

Julio Jones caught a 5-yard pass from Matt Ryan with two seconds left to give Atlanta a 23-22 lead.

Wide receiver Olamide Zaccheaus recoverd a fumble in the end zone when the 49ers botched the kickoff return when they lateraled in a futile attempt to score on a razzle-dazzle return.

The 49ers (11-3) nevertheless made it into the NFC playoff field minutes later when the Dallas Cowboys wrapped up their 44-21 win over the Los Angeles Rams.

The Cowboys’ win also put the Green Bay Packers and the Seattle Seahawks into the playoffs.

The New England Patriots clinched their 11th consecutive playoff berth this weekend despite another pedestrian passing performance by Tom Brady.