The Arizona Cardinals stretched their defensive performance to turn their dominance into a win over the San Francisco 49ers on Sunday night football, improving to 5-0 for the first time in decades.

With nearly five minutes remaining in the game, DeAndre Hopkins secured a 9-yard touchdown after breaking a strong defense from San Francisco’s Josh Norman. The final quarter stride pushed the Cardinals to a 10 point lead, with the final tally being 17-7.

Kyler Murray completed 22 of 31 passes for 239 yards. Hopkins caught six passes for 87 yards.

Also Read: NFL: The longest field goals in the league’s history

Niners rookie quarterback Trey Lance had an up-and-down first start, making some impressive plays with his arm and feet. But the San Francisco offense struggled in many of the biggest moments, converting 1 of 5 chances on fourth down.

Lance finished 15 of 29 passing for 192 yards and one interception. He also led the team with 89 yards rushing.

The Cardinals settled for a 10-0 halftime lead after Matt Prater missed a 61-yard field goal attempt as time expired. The 49ers (2-3) did a good job of slowing Arizona’s offense, which came in averaging an NFL-best 35 points per game.

Also Read: NFL: Matt Ryan helps Atlanta Falcons close out 27-20 win over New York Jets

The 49ers finally broke through on offense late in the third quarter when Deebo Samuel ran 13 yards for a touchdown, cutting the deficit to 10-7. Samuel came in as the NFL’s leading receiver and also proved a capable runner, taking the pitch from Lance and evading several Cardinals on the way to the end zone.

San Francisco had a few more chances in the fourth quarter but couldn’t convert on fourth downs. Kyle Juszczyk was stopped short on fourth-and-1 at the Cardinals 48 and Arizona defensive lineman J.J. Watt deflected a fourth-down pass a few minutes later.

Arizona, the NFL’s only remaining undefeated team, grabbed a 7-0 lead midway through the first quarter thanks to an efficient eight-play, 66-yard drive capped by a 1-yard touchdown run by James Conner.

Also Read: NFL: Patriots’ Damien Harris suffers rib injury in clash against Texans

Lance was making his first career start in place of the injured Jimmy Garoppolo, inactive for the game because of a calf injury suffered in last week’s loss to Seattle. The 21-year-old rookie had a rough start, throwing an interception after sailing a pass past his intended receiver and right into the arms of Arizona safety Budda Baker. He was also stopped on two fourth-down runs, including one inches shy of a touchdown.

On that play, Lance scrambled to his right and looked like he was going to score, but Isaiah Simmons and Tanner Vallejo closed quickly, meeting the quarterback just before the goal line in a violent collision. Simmons was evaluated for a concussion after the play, but later returned to the game.

(With AP inputs)