Warner finally squashed those butterflies -- and San Francisco's playoff hopes -- with one last clock-killing drive.
Leinart passed for 162 yards before spraining his left shoulder before halftime, and Warner finished up with 105 yards passing in the Cardinals' fourth victory in six games, 26-20 to eliminate San Francisco (6-9) from postseason contention.
Leinart was injured when Roderick Green sacked him shortly before halftime, and the 2004 Heisman Trophy winner is out for the season. Warner, the former shelf-stocker who became a superstar, was back in charge nearly three months after losing his job to the high-profile rookie.
Warner wasn't asked to do much while Arizona nursed a second-half lead, but he coolly directed Arizona's final drive, completing two long passes for first downs before finishing the Cards' five-minute march with three straight kneeldowns.
"We just want to finish the season finally playing the way we wanted to play the whole year," Warner said. "I think they know what I can do, but when you sit out for 10 weeks, even you aren't sure how you're going to feel, what the speed of the game is."
Warner also appeared to back off recent retirement talk, saying, "I feel great. I want to play some more (next season), but in what capacity and where, that's to be determined."
Improbably, Arizona is a division-best 4-2 against NFC West opponents during its eighth consecutive losing season.
"Unofficially, we're the best in the West," James said. "Even though we don't get a chance to go to the playoffs, we know we have the best divisional record, and that's big. This is something you learn from."
Gore rushed for just 51 yards, failing to surpass Garrison Hearst's single-season rushing record in a roundly disappointing afternoon for the 49ers, who still entertained hopes of winning the division and getting to the playoffs just two seasons after going 2-14.
"You can't learn anything from losing," 49ers linebacker Brandon Moore said. "You can say we played well, but when it comes down to it, you learn nothing from losing except losing."
Neil Rackers, who kicked six field goals in the Cardinals' win over San Francisco in Mexico City last season, connected from 25, 39, 37 and 32 yards -- but television replays appeared to show his 37-yarder on the first play of the fourth quarter actually missed.
Leinart's injury was just one of several personnel problems for both teams. Linebacker Gerald Hayes, Arizona's leading tackler, was scratched for the first time all season with injured ribs, while cornerback David Macklin strained his hamstring early in the second half.
The 49ers lost left tackle Jonas Jennings to a dislocated right shoulder in the first quarter, and Arnaz Battle had seven catches while picking up the slack from Antonio Bryant, who began his four-game suspension for violating the NFL's substance abuse policy.
"The guys that stepped in did a good job, but it wasn't enough," Smith said. "We had a lot of distractions this week. It's important to get back to football next week and make the most of one last game."
Smith threw a tipped interception and Battle fumbled on consecutive offensive plays in the fourth quarter while San Francisco trailed by less than a touchdown. The Niners then converted a fourth down on the way to Gore's 1-yard TD plunge, but never saw the ball again.
The Cardinals beat San Francisco 34-27 in the opening game in their gorgeous new stadium in September, but lost their next eight games to spark rumors of coach Dennis Green's imminent firing. Yet with Leinart building cohesion with his teammates each week, Arizona has become an improved offensive team, scoring at least 17 points in seven straight games.
"We don't like the fact that we're not in the playoff hunt," Green said. "A lot of teams got eliminated today, including San Francisco."