Updated

The Arizona Cardinals have found respectability. A come-from-behind victory over San Francisco made that official.

That's saying something for a team that not long ago was 1-6 and had lost six in a row.

Kevin Kolb, in his second start for Arizona after missing four games with a right foot injury, took a knee to the head from the 49ers' Ahmed Brooks on the third play of the game and left the contest for good. That brought in John Skelton, who was so bad when he faced the 49ers a month ago he was benched after throwing three interceptions in three quarters.

This was a different story.

Skelton still had turnover problems — two interceptions and a fumble — but threw for three touchdowns and led the Cardinals to a 21-19 come-from-behind victory over the newly crowned NFC West champions.

The Cardinals (6-7) won for the fifth time in six games, with that loss at San Francisco the only blemish in the span. They also ended San Francisco's five-game winning streak in the series.

Arizona's defense, the strength behind the team's resurgence, kept the 49ers out of the end zone in the first half, then the game completely changed in the second.

San Francisco (10-3) had a 10-2 advantage in first downs in the first half, Arizona 10-2 in the second. The 49ers had a 155-97 edge in yards in the first half, Arizona dominated the second 228-78.

"We started converting third downs. That's what it comes down to, sustaining drives," Skelton said. "Our defense was on the field the entire first half, it seemed like."

Not that the second half started that well for Arizona.

Frank Gore's 37-yard touchdown run 2½ minutes into the third quarter put San Francisco up 19-7, but the Cardinals didn't see much more of the big running back after that.

The loss dropped San Francisco (10-3) into a tie with New Orleans for the second-best record in the conference. The top two teams earn a first-round bye.

"We have to be honest with ourselves when we look at the film," quarterback Alex Smith said. "It is not something we can just dismiss and move on. We are into December now and we have to continue to get better. We just can't dismiss this. "

Larry Fitzgerald had seven catches for 149 yards, including a 46-yarder for a touchdown and a 53-yarder to set up the go-ahead score. It was his 30th career 100-yard receiving effort. He also had a vicious block that helped free Early Doucet on a 60-yard touchdown reception.

"That's Fitz being Fitz," Skelton said.

San Francisco had the ball inside the Arizona 10 three times in the second quarter and came away with only field goals. They also had third-and-1 and then fourth-and-1 at the San Francisco 41 with about two minutes to go.

In both cases, passes fell incomplete, the last one after Smith scrambled all over half the field before throwing.

"If you score touchdowns down there, a different game," Smith said. "The end of the game was disappointing, as well. Having a chance to win it and don't get it done."

It was the latest in a series of strong performances by an Arizona defense that has allowed six touchdowns in six games.

"I'm proud of us. I'm proud of our team that stuck together not complaining about anything," defensive tackle Darnell Dockett said.

Arizona sacked Smith five times after getting five against Dallas in its 19-13 overtime win over the Cowboys a week earlier. The loss ended a five-game 49ers winning streak in the series.

"I thought we were in position to win this football game really at all times during the game," San Francisco coach Jim Harbaugh said. "We didn't get it done and we are disappointed about that. We look forward to seeing how our team responds to some adversity. We haven't had a lot of it this year."

Frank Gore rushed for 72 yards on 10 carries for the NFC West champion 49ers, including a 37-yard touchdown run that put San Francisco ahead 19-7 early in the second half. He broke 1,000 yards rushing for the fifth time in his career, but didn't do much damage after that.

Smith completed 18 of 37 for 175 yards and no TDs.

The 49ers were without standout inside linebacker Patrick Willis, who missed the second game of his career because of a right hamstring injury.

Still, the 49ers' defenders felt they had failed in areas where they had succeeded almost always this year.

"As a secondary, we felt like it was really on our shoulders and we lost this football game collectively," safety Donte Whitner said. "It doesn't matter what the offense does, if they can't get it in, all we need are field goals. We felt like we let the team down and we're going to go back to the drawing board and we'll be ready."

The oddest moment of the game came in the second quarter.

On third-and-7, Skelton scrambled for a first down but, on a hit by Smith, fumbled the ball and San Francisco recovered at its 47. The 49ers moved to the Arizona 32, where Akers lined up for a 50-yard field goal attempt. But it was a fake, with holder Andy Lee tossing to backup center Jonathan Goodwin, lined up as a tight end, for the apparent score.

The whistle blew midplay, though, with Arizona challenging the previous play, a pass from Smith to Kyle Williams. But the replay system wasn't working so the play had to be repeated. This time, Akers' kick was wide right.

"Luckily, we used our 'fake field goal red flag challenge' that stopped that one," Whisenhunt said.

The next play, Skelton threw over the middle to Doucet, and with the help of Fitzgerald's block, he raced 60 yards for the score and Arizona led 7-6 with 7:10 left in the half.

"It ended up being a 14-point swing when you look at it," Harbaugh said.

Notes: Fitzgerald is the eighth player in NFL history to top 1,000 yards receiving in six of his first eight seasons. ... For the second week in a row, all five Arizona sacks were by different players. ... Dashon Goldson left the game with a hip injury on the play Fitzgerald scored. ... San Francisco lost starting left Joe Staley in the first quarter with a head injury.