GLENDALE, Ariz. — Kyle Allen on Sunday gave the Carolina Panthers plenty of reasons to give starting quarterback Cam Newton at least another week to rehab his sore left foot.

The second-year undrafted player out of the University of Houston threw four touchdown passes and looked extremely poised in a 38-20 victory over the Arizona Cardinals that snapped a two-game losing streak.

There was uncertainty among team officials whether Newton would be ready to return for next week’s game at Houston. Allen’s play might have given them the confidence to stick with the Scottsdale, Arizona, native regardless.

“He’s our quarterback, and he’s who we rely on,” coach Ron Rivera said about Newton when asked if he automatically would be the starter when healed. “But for now, right now, we’re going to stick with Kyle. Keep rolling and see how things unfold as we go forward.”

Rivera mentioned Allen had some swag, a phrase often used in reference to Newton, who typically shows up for postgame interviews in a hat or scarf or an outlandish outfit. The ninth-year coach jokingly said he hopes Allen doesn’t start dressing funny.

Allen showed up in a polo shirt, pants and tennis shoes.

“You don’t have to have a hat to have swag, man,” Allen said with a laugh.

Allen definitely brought energy and efficiency to the offense. He completed 19 of 26 pass attempts for 261 yards with no interceptions. His biggest mistake was a fumble on a strip sack to end his first series, but he was blindsided by linebacker Chandler Jones.

Otherwise, he had a quarterback rating of 144.4 that was the second-best in team history.

If the Panthers (1-2) needed more reason to give Allen another shot, they have won only twice in their past 11 games and Allen has been the starting quarterback in both.

He guided Carolina to a 33-14 victory in last year’s season finale to snap a seven-game losing streak.

“He’s real confident in who he is as a football player,” Rivera said of Allen. “He’s got a lot of swag, which is interesting when you watch him and he’s been able to back it up. The biggest thing is he did it in high school, he did it in college and the two times he’s played for us he’s played well.

“Hopefully, he can continue that.”

Sunday’s victory saved Rivera from the first 0-3 start of his career — and perhaps saved Carolina’s season.

Allen showed the poise that former NFL quarterback Jordan Palmer predicted earlier in the week.

“I’ve been paying attention since high school and I’ve had a lot of conviction on him for a long time, so I’m not surprised at all he’s in this position and I’m not going to be surprised at all when he plays really, really well and this offense really starts clicking,” said Palmer, who has been Allen’s mentor since high school.

Allen predicted after a preseason in which he and Newton failed to lead the Panthers to a touchdown that the offense would be explosive. It was on this day, with the efficiency of Allen and the dominance of running back Christian McCaffrey.

McCaffrey had a career-long 76-yard touchdown run in the second half en route to 153 yards rushing on 24 carries. He also caught three passes for 35 yards in his pursuit of becoming the third back in NFL history to have 1,000 yards rushing and receiving in the same season.

But it was Allen who stole the show, and he began early. He had two first-half touchdowns after Newton failed to get the Panthers into the end zone in the first half of the first two games.

His second and fourth touchdown passes displayed his mobility as he escaped pressure to buy time before finding Curtis Samuel for a 5-yard score and tight end Greg Olsen for a 3-yarder.

“He has just enough mobility to get him out of some situations,” Rivera said. “He was able, once he got a feel for things, he was able to move away from the pressure and he handled it very well.”

Olsen proved to be the security blanket for Allen that he was for Newton before a foot injury sidelined him much of the past two seasons. He had a team-best six catches for 75 yards and two touchdowns, his first multi-touchdown game since Week 3 of the 2015 season.

“He’s got a good way about him,” Olsen said of Allen. “One of the first things you notice about him is he gets in there. He’s very under control, and he’s very relaxed. He’s got a good demeanor to him, good or bad.”

Allen is the first Carolina quarterback to throw four touchdown passes in a game since Newton had that many in a victory against Green Bay in December 2017. His 144.4 passer rating trailed only Newton’s 153.3 during the 2015 season.

“Not surprised at all,” Samuel said. “We knew what he was capable of, and our job is to go out there and win, give him the best chance to complete a pass for us.”