San Francisco, CA (SportsNetwork.com) - Vernon Davis had eight catches for 180 yards and two touchdowns -- almost all of it coming in the first half -- and the San Francisco 49ers beat the Arizona Cardinals 32-20 on Sunday for their third straight win.

Davis was a frequent target of Colin Kaepernick early on, catching seven passes for 171 yards and two scores before halftime, including a 61-yarder.

"We knew he'd be a mismatch," Kaepernick said of Davis. "He came to play today."

Kaepernick had 252 yards passing, but also turned the ball over twice, and Frank Gore ran for 101 yards on 25 carries for the 49ers (4-2), who have beaten the Cardinals five straight times at home.

Kendall Hunter had a 6-yard touchdown run for the 49ers in the fourth quarter that came after a Larry Fitzgerald fumble and capped a 9 1/2-minute drive spanning 18 plays and 89 yards.

The Cardinals (3-3) had a two-game winning streak snapped and will have just three days off before playing Seattle at home on Thursday night.

Carson Palmer threw for 298 yards and two touchdowns -- a 75-yard hookup with Fitzgerald and a 10-yard pass to Michael Floyd -- but threw two interceptions that led to field goals for San Francisco.

Andre Ellington added a 15-yard touchdown run in the loss.

Cardinals defensive end Calais Campbell was carted off on a stretcher late in the fourth quarter after going head-first into a pile at the end of a run by Gore but was moving all his extremities, the team said.

The 6-foot-8, 300-pound end, who has 31 sacks in six season for the Cardinals, was taken to the hospital to be checked out.

The 49ers beat the Rams and Texans by a combined 69-14 after losses to the Seahawks and Colts by a 56-10 margin, but found themselves in a fight late into this one.

Floyd's 10-yard touchdown catch in the back left corner of the end zone came against Tarell Brown and got the Cardinals within 22-20 in the third quarter after a two-point conversion try failed.

Fitzgerald's fumble and a long drive freed up some room for the 49ers.

The receiver had the ball jarred loose by 49ers linebacker Patrick Willis and the fumble was recovered at the San Francisco 11 by safety Eric Reid, who was also close to the initial tackle.

"I'm not going to sleep at all," Fitzgerald said. "I let my team down."

Fullback Bruce Miller picked up a first down on 4th-and-1 from the Arizona 34 during the 18-play drive. Later, Gore ran five straight times for 22 yards to set up Hunter's run.

Rookie Cardinals safety Tyrann Mathieu had Hunter wrapped up and threw him to the ground in the end zone -- drawing one of three offsetting personal foul penalties issued on the play.

Alfonso Smith fumbled on the ensuing Cardinals possession and the 49ers turned it into Phil Dawson's 44-yard field goal for the final score.

Palmer was picked off twice in the first quarter but the 49ers only got two field goals out of it.

Eric Reid's 53-yard return set up Dawson's 35-yard field goal and Carlos Rogers' 11-yard return led to Dawson's 26-yarder for a 6-0 lead.

Fitzgerald broke a tackle and got a last-second block by fellow wide receiver Brittan Golden on his 75-yard touchdown to quickly give the Cardinals the lead three plays into the ensuing drive.

Yeremiah Bell intercepted Kaepernick at the Arizona 1 but all the turnover did was lead to more 49ers points -- on rookie linebacker Corey Lemonier's first career sack, a safety that made it 8-7 49ers in the second quarter.

They stretched it to 15-7 after Davis got behind two defenders over the middle and Kaepernick hit him for the 61-yard touchdown.

Golden had a 53-yard catch to set up Ellington's 15-yard touchdown run to get the Cardinals within 15-14, but Kaepernick slipped a pass behind Bell and into Davis' hands for a 35-yard touchdown to make it 22-14 with 1:55 left in the first half.

Kaepernick had a late fumble, but the Cardinals didn't score.

Game Notes

Fitzgerald had six catches for 117 yards ... Ellington rushed seven times for 56 yards ... The 49ers play at Tennessee next Sunday ... Davis had 14 catches for 224 yards and four touchdowns in four games prior to Sunday ... The last Cardinals win in San Francisco came on Sept. 7, 2008.