SAN FRANCISCO -- Alex Smith acknowledged he couldn't have played much worse in the first 57 minutes of the San Francisco 49ers' opener, which made his final three minutes even more stunning.
Yet no matter the year or the coaching staff, there's nothing surprising about another gut-wrenching loss for the Arizona Cardinals.
Arnaz Battle scored on a 1-yard end-around with 22 seconds to play, and the 49ers erased an inept offensive performance with an 86-yard scoring drive to cap a 20-17 victory over the Cardinals in the NFL's final opener Monday night.
Smith knew he looked terrible until leading that near-flawless march on chilly Bill Walsh Field for the 49ers, who beat the Cardinals for the first time in five tries during coach Mike Nolan's tenure.
Never miss a local story.
"The win is the most important thing, ugly or not," Smith said. "I think we (showed) character to really hang in there and know we were going to get it done."
Smith finished 15-of-31 for 126 yards -- 60 on the final drive.
The third-year quarterback also made a key 25-yard scramble on fourth-and-1, and Battle hauled in a gutsy catch at the 1 before running it in for the decisive score.
"Offensively, we saved our best for last, which is the best thing I can say for us," Nolan said.
Both teams' high-priced offenses floundered amid the swirling winds in the first game since the field was renamed in Walsh's honor -- but the Cardinals' slip was particularly cruel, even by Arizona standards.
Anquan Boldin caught a 5-yard touchdown pass from Matt Leinart with 6:40 to play for the Cardinals, who kept the 49ers out of the end zone for 55 straight minutes between Frank Gore's early score and Battle's final TD.
"The defense held up the whole game until that last drive," Arizona cornerback Eric Green said. "You can play great the whole way, but if you mess up one play, it's like you didn't play well at all."
Arizona's defense finally bent at the end, handing new coach Ken Whisenhunt a typically crushing Cardinals loss in his debut. He's the ninth consecutive coach to lose his first game with the Cards.
After Leinart hit Boldin to cap the Cardinals' go-ahead drive, San Francisco finally got something going two series later.
After Darrell Jackson let a 45-yard pass go through his hands in the end zone with 1:37 left, Smith scrambled to the Arizona 20 on the Niners' longest play of the game. Battle then caught a pass near the goal line with about 30 seconds left, but safety Terrence Holt knocked it out of his hands as he stretched for a touchdown.
The ball dribbled into the end zone, where Green misplayed it and Jackson recovered. Because only the fumbler can recover for his team if the ball goes forward in the final two minutes, it was placed at the 1.
Battle, who promised a steak dinner to Jackson for recovering the fumble, scored on the next play.
Shawntae Spencer intercepted Leinart's final pass with 8 seconds left.