GLENDALE, Ariz. -- The Arizona Cardinals accomplished something they hadn't done since the team moved to the desert 20 years ago.
They won on Monday night.
So what if it was a struggle down to the wire? This victory felt just fine to a franchise that has had oh-so-little to cheer about for decades.
Kurt Warner's ageless arm and an improbable goal-line stand at the finish saved the Cardinals from an ugly loss on a national stage.
The Cardinals stopped Michael Robinson up the middle from the 2-yard line as the game ended to preserve a 29-24 victory over San Francisco.
"That was definitely one of the most frustrating losses I can remember in my 15 or 16 years playing football," 49ers center Eric Heitmann said.
The Arizona players were just as stunned as about every 49ers fan that Frank Gore didn't get the ball for that last carry.
"I told Frank after the game, he's their best player," Arizona defensive back Adrian Wilson said. "In that situation, you've got to demand the ball. To have him as a wideout, to me, that's not their best play."
San Francisco interim coach Mike Singletary said the play was called by offensive coordinator Mike Martz.
"I think Coach Martz felt that there would be a cavity inside, so he made the call," Singletary said. "So you've got to live with the result."
Who made the game-saving tackle?
"We all did," defensive tackle Darnell Dockett said.
Singletary said his team could have "done a heck of a lot better job" managing the final seconds.
Warner finished 32-of-42 for 328 yards and three touchdowns without an interception in Arizona's sixth consecutive home victory, fourth this season.
San Francisco (2-7) had two chances after that.
The first ended on Wilson's diving interception of Shaun Hill's pass. The second was much more nerve-racking for the home team and exasperating for the 49ers, who lost their sixth in a row.
Hill's 14-yard pass to Jason Hill moved it to the Arizona 1. With the last few seconds ticking off, Gore was pushed by a defensive player as he ran around left end, then stumbled to the ground just outside the 2.
After officials reviewed the play to make sure Gore was down by contact, the 49ers handed off to the fullback Robinson, who was stuffed nowhere near the goal line.
Arizona coach Ken Whisenhunt stressed the positives, including the goal-line stand.
"We found a way to win a tough game, which is something you have to do," he said.
The Cardinals won on Monday night for the first time in six tries since they moved to the desert and opened a four-game lead in the NFC West. The other three teams in the division -- San Francisco, Seattle and St. Louis -- are all 2-7.
Allen Rossum returned the opening kickoff 104 yards for a touchdown and the 49ers never trailed until Arizona's late score.
"It would have been nice to have a blowout but hey, those games are sweet when you win," Warner said. "Man, it's fun. It's fun to pull these out. It would have been a heartbreaker to have lost it."
Shaun Hill, replacing the benched J.T. O'Sullivan for his third career start in seven NFL seasons, threw for two touchdowns in the first half but lost a fumble and threw two interceptions in the second. He finished 19-of-40 for 217 yards.
Rossum, who left the Seattle game two weeks ago with a hamstring injury, showed no ill effects on the opening kickoff. He caught the ball four yards deep in the end zone, then ran upfield and darted to his left, going untouched yards for a touchdown.
It was his fifth career kickoff return for a score and was just one yard short of the team record.
Tight end Vernon Davis, sent to the locker room by interim coach Mike Singletary two weeks ago during a loss to Seattle, caught an 18-yard pass over the back of Wilson for a touchdown with 29 seconds left in the half to give San Francisco a 21-13 lead.
The 49ers had gone ahead 14-3 on Josh Morgan's juggling catch of Hill's 31-yard touchdown pass with 14:13 left in the half.
That's when Arizona's vaunted offense finally got in gear. Warner's 46-yard pass -- at least 50 yards in the air -- to Steve Breaston set up a 13-yard TD pass to Boldin that cut the lead to 14-10. Neil Rackers' second field goal of the half, from 33 yards, made it 14-13.
But the 49ers went 77 yards in 14 plays for their final first-half touchdown. The crucial play came on third-and-11 from the San Francisco 22 when Shaun Hill kept the ball, had his helmet ripped off but still got the final two yards of a 12-yard gain for the first down.
Notes: For the first time this season, the roof at University of Phoenix Stadium was open. ... Aeneas Williams was added to the Cardinals Ring of Honor at halftime. ... The longest kickoff return in San Francisco history was 105 yards by Abe Woodson against the Los Angeles Rams on Nov. 8, 1959.
Panthers QB Cam Newton was caught dabbing on camera during the Hornets-Cavaliers game.
With Cam Newton sitting courtside, J.R. Smith does his best 'Dab' and 'Superman' celebration, paying tribute to the Panthers quarterback.
Michael Floyd's recovery from a hamstring injury is going well -- he practiced Friday and said he feels ready to play against the 49ers.
Dannell Ellerbe, David Hawthorne and Damian Swann won't play Sunday, while Mark Ingram, Stephone Anthony and Hau'oli Kikaha are listed as probable.
NFL vice president of officiating Dean Blandino acknowledged Friday that the inadvertent whistle in the Bills-Patriots game blew before the catch.
Carlos Hyde will miss his fourth straight game as he continues to recover from the stress fracture in his left foot.