The 49ers and Cowboys are in a shootout at AT&T Stadium.

In an entertaining first half, the difference is an extra point. Cowboys kicker Brandon Aubrey missed one, giving the 49ers a 17-16 halftime lead.

Christian McCaffrey scored on a 74-yard catch-and-run touchdown after Brock Purdy rolled to his right to buy time. Eddy Pineiro’s PAT gave San Francisco a lead with 2:26 remaining in the first half.

The 49ers’ other points came on Deebo Samuel’s 11-yard touchdown catch and Pineiro’s 28-yard field goal.

The 49ers outgained the Cowboys 244 to 165, with Purdy going 12-of-17 for 217 yards and two touchdowns. McCaffrey has two catches for 81 yards and a touchdown and eight rushes for 21 yards.

The 49ers can’t cover George Pickens, who returned from a one-game absence with a hamstring injury and has touchdowns of 35 and 39 yards. He has six catches for 97 yards.

Dak Prescott is 7-for-17 for 104 yards and two touchdowns, with Ryan Flournoy having the only other catch besides Pickens’ six.

Aubrey kicked a 52-yard field goal on the team’s first drive.