AP photo by Tony Avelar / Atlanta Falcons quarterback Matt Ryan is hit by San Francisco 49ers defensive end Arden Key, who was called for a penalty on the play, during the first half of Sunday's game in Santa Clara, Calif.

SANTA CLARA, Calif. — The San Francisco 49ers didn't let a lackluster first two months of the season ruin their year, and on Sunday they didn't let a poor start to their game against the Atlanta Falcons become more than just that.

The result was a 31-13 San Francisco victory that revved up the 49ers' playoff hopes and cooled Atlanta's surprising push for a wild card in an NFC that's wide open in the middle of the standings.

Jimmy Garoppolo threw for 235 yards and a touchdown, and the 49ers (8-6) ran for three more scores as they won for the fifth time in six games. They scored touchdowns on four straight drives to make easy work of the Falcons (6-8) and remain in wild-card position as the sixth-place team in the conference.

"Guys were locked in today," Garoppolo said. "You felt it throughout the week, too. It was a big game, NFC opponent, playoff picture and everything like that. It's December football. We knew what we were in for."

After stumbling to a 3-5 start, San Francisco has turned its season around by cutting down on turnovers, controlling the game on the ground and using a relentless pass rush on defense.

"I think we're peaking at a good time," fullback Kyle Juszczyk said. "We're definitely not playing the best as we can. There's a lot of things that didn't exactly go our way, but we were able to battle back and not let it faze us early on."

The game couldn't have gotten off to a much better start for the Falcons, who recovered a fumble on the opening kickoff at San Francisco's 12-yard line. However, their inability to turn that early Christmas gift into points set the tone for another lopsided defeat to a contender.

Atlanta has been outscored by 23.8 points per game in losing all five of its matchups this season against teams that currently have winning records.

"When you're playing a good football team in an important game, you have to find ways to score and you have to take advantage of those opportunities," Falcons quarterback Matt Ryan said. "That's something we have to be better at moving forward. When you get turnovers, you get short-field opportunities, you have to go attack and find a way to get the job done."

some text
AP photo by Tony Avelar / Atlanta Falcons tight end Kyle Pitts cannot catch a fourth-down pass from Matt Ryan in front of San Francisco 49ers safety Jaquiski Tartt during the first half of Sunday's game in Santa Clara, Calif.

The Falcons failed at that repeatedly as they were unable to score a touchdown on 13 plays they ran from the 10-yard line or closer, including five from the 1. Only one NFL team in the past 30 years ran more plays from the 1-yard line without scoring, and the Falcons failed to score a touchdown on all three of their goal-to-go drives, marking the first time they did that since 2004.

Atlanta was coming off a 29-21 road win against the Carolina Panthers in NFC South Division play. The Falcons have posted back-to-backs wins just once this season, Arthur Smith's first as head coach.

"We made plays down the field, but we didn't make the critical plays down in the red zone," Smith said. "That was the difference in the game. Credit to San Francisco. They had a say, and they stopped us in the red zone."

It started on their opening possession created when San Francisco's JaMycal Hasty fumbled on the kickoff return. Two plays later, Atlanta was at the 1 after a 7-yard pass from Ryan to rookie tight end Kyle Pitts.

Cordarrelle Patterson appeared to run it in on the next play, but a replay review overturned it. Ryan then threw an incomplete pass on second down, Patterson was stopped for no gain on third and Ryan was unable to hit Pitts on fourth.

The Falcons got down close again three more times in the second half, but they settled for a 22-yard field goal from Younghoe Koe in the third quarter after Ryan threw incompletions on second and third down. They then were stopped again in the fourth quarter on fourth-and-1 from the 8 on one drive and the 1 on another.

Atlanta lost a fumble on a strip sack by Nick Bosa on the opening drive of the second half. That fumble recovery by Fred Warner came two plays after Samson Ebukam opened the half with a sack. It helped the 49ers take control as they took advantage of the good field position to drive 38 yards and take a 24-10 lead on Jeff Wilson Jr.'s 5-yard run.

San Francisco held Atlanta to 62 rushing yards. Ryan threw for 236 yards with a 20-yard touchdown to Russell Gage in the first half, but he was under relentless pressure most of the game and was sacked three times.

The Falcons are in 11th place in the NFC, but their bid for the franchise's first playoff berth since the 2017 season remains alive. So does their hope of finishing above .500 for the first time since then, but it will require winning out against the Detroit Lions, Buffalo Bills and New Orleans Saints.

"We'll just keep swinging," Smith said. "A lot of crazy things have happened in the NFL. So we'll try to get the next one. We're going home, we'll just keep chipping away and see what happens. Because there's a lot of things, what it looks like today, that's not how it's going to look like after Week 18. You get to the last week of the season, you just want to have a mathematical chance.

"Crazier things have happened."