SANTA CLARA, Calif. (AP) — Brock Purdy threw a touchdown pass and ran for another score to send the San Francisco 49ers into their bye week on a high note with a 30-24 victory over the Dallas Cowboys on Sunday night. The Niners (4-4) bounced back from a loss last week in a Super Bowl rematch against Kansas City with a strong performance against the Cowboys (3-4) that they hope will set them up for another big push in the second half of the season.

San Francisco went 16-2 following its Week 9 bye week the past two seasons to make it to the NFC title game in 2022 and the Super Bowl last season. Purdy led three straight touchdown drives to turn a 10-6 halftime deficit into a 27-10 lead, but San Francisco had to hold on late after Dak Prescott threw two TD passes to CeeDee Lamb to cut the deficit to six. Prescott had a chance to complete the comeback but threw four straight incomplete passes after getting the ball back with 3:05 left in the fourth quarter.

San Francisco took control in the third quarter, driving 60 yards after the opening kick of the half to score on rookie Isaac Guerendo's 4-yard run. Deommodore Lenoir's interception that set up San Francisco in Dallas territory, leading to Purdy's 2-yard touchdown pass to George Kittle, who finished with six catches for 128 yards. The Niners then drove 75 yards for another TD when Purdy scored on a sneak from 2 yards out.

Purdy bounced back from a three-interception performance last week against the Chiefs to go 18 for 26 for.