TAMPA, Fla. (AP) — Dak Prescott outplayed Tom Brady, throwing for four touchdowns and running for another to lead the Dallas Cowboys to a 31-14 victory, locking them into a match-up against the San Francisco 49ers.

Prescott completed 25 of 33 passes for 305 yards and played turnover-free ball for the first time in eight games as the Cowboys (13-5) dominated the listless Bucs (8-10) in what may turn out to be Brady’s last game in a Tampa Bay uniform.

Dallas beat Brady for the first time in the seven-time Super Bowl champion’s career and won in the postseason on the road for the first time in 30 years to earn a trip to San Francisco to face the 49ers in the NFC divisional round next Sunday.

The Cowboys had dropped eight straight playoff games on the road since winning the NFC championship game in San Francisco on Jan. 17, 1993.

Brady, who signed with Tampa Bay in 2020 and led the Bucs to a Super Bowl title two years ago, will be a free agent this winter. He retired briefly last February before changing his mind and returning for a 23rd season at age 45.

About the only thing that went wrong for the Cowboys on Monday night was kicker Brett Maher missing his first four extra points, becoming the first player in NFL history to miss that many in a game. Maher finally converted on his fifth attempt after coach Mike McCarthy decided against sending him out to try a field goal from roughly the same distance as a PAT.

Tampa Bay receiver Russell Gage was strapped to a backboard and carted off the field after an injury late in the fourth quarter. Gage slipped and fell to the turf while running a route and took a blow to the neck area as he went down. He was unable to get to his feet and silence fell over the stadium as players took a knee and medical personnel tended to him.