SANTA CLARA, Calif. — The Miami Dolphins hit San Francisco's vaunted defense with a 75-yard haymaker on the opening play and then watched 49ers quarterback Jimmy Garoppolo leave with a season-ending foot injury.
Everything was set up for another win for the streaking Dolphins, but backup quarterback Brock Purdy and the Niners had other ideas.
Purdy threw two touchdown passes after replacing Garoppolo and San Francisco used another dominant defensive performance to beat Miami 33-17 on Sunday for its fifth straight win.
"Guys were a little off, just in general collectively," Dolphins coach Mike McDaniel said. "But I know one thing: It wasn't because of preparation, lack of detail. It was one of those things that you have to go through."
Tua Tagovailoa threw a 75-yard touchdown pass to Trent Sherfield on the opening play from scrimmage but struggled to do much else behind a patchwork line for Miami (8-4) against Nick Bosa and the Niners' defense.
Tagovailoa, who came into the game with three interceptions on the season, threw two in the third quarter to Jimmie Ward and Deommodore Lenoir to lead to a pair of field goals for the 49ers (8-4).
"It sucks that we didn't come out and say what we wanted to do collectively as a team," Tagovailoa said. "Obviously, it starts with me offensively. Turnovers, with third-down communication errors, in that retrospect it's hard to win a game when you’re not on your Ps and Qs and you're not dialed in."
The 49ers had their four-game, second-half shutout streak snapped when Tagovailoa threw a 45-yard TD pass to Tyreek Hill in the opening minute of the fourth quarter but held on from there. They capped the performance with a strip-sack from Bosa that Dre Greenlaw returned for a 23-yard score.
Bosa finished with three sacks, taking advantage of a line missing starting tackles Terron Armstead and Austin Jackson.
"We didn't flinch," Niners linebacker Fred Warner said about the response to the opening play. "We came back to the sideline and you can't look at things like that emotionally. You've got to just look at it for what it is and and see how you can adjust. I guess that kind of allowed us to really settle into the game quicker, obviously when you when you have a play like that."
The Dolphins had their five-game winning streak snapped in coach McDaniel's first game against the 49ers after spending the past five years as an assistant in San Francisco.
Purdy, dubbed "Mr. Irrelevant" as the last pick of this year's NFL draft, proved to be quite important to the 49ers when Garoppolo broke his left foot on a sack on the final play of the opening drive.
Garoppolo was taken to the locker room on a cart and didn't return, leaving the game in the hands of Purdy, who had thrown his only nine passes in mop-up duty of a Week 7 loss to Kansas City.
Purdy capped his first drive of the game by throwing a 3-yard TD pass to Kyle Juszczyk to give San Francisco a 10-7 lead.
He then led a well-executed two-minute drive at the end of the half, completing six passes for 75 yards with a 3-yard TD to Christian McCaffrey with 4 seconds left in the half to make it 17-10.
Purdy finished 25 for 37 for 210 yards, two TDs and one interception.
"It’s pretty crushing. We know what Jimmy's been through, how hard he's worked at this," coach Kyle Shanahan said. "That was a really cool game, just as a team and all the stuff that went on throughout the game and just be able to overcome some things. So it's such a special win. But definitely mixed emotions hearing about Jimmy."