Vernon Davis catches a touchdown pass — one that was initially ruled out of bounds — to help San Francisco beat Carolina, 23-10. (Bob Donnan/USA Today Sports)

The San Francisco 49ers are headed to the NFC title game for the third time in three seasons under Coach Jim Harbaugh after outlasting the Carolina Panthers, 23-10, on Sunday in a rugged, inelegant conference semifinal.

The fifth-seeded 49ers, after winning in frigid Green Bay the previous weekend, came here and ended the season of the second-seeded Panthers. They’ll play at top-seeded Seattle next Sunday in the NFC championship game as the 49ers attempt to reach the Super Bowl for a second straight season.

“We expect this,” San Francisco safety Donte Whitner said. “We’ve been here. This is not our first time. We’re not excited. . . . It really felt like another game to us. I don’t know if it was their Super Bowl or not. But it was another game to us. Until we get back to the Super Bowl and bring that trophy back, we’re gonna treat all these games like just another game.”

Quarterback Colin Kaepernick threw a touchdown pass to tight end Vernon Davis in the final seconds of the first half and ran for a third-quarter touchdown as the 49ers scored the game’s final 17 points. The San Francisco defense crafted a pair of first-half goal line stands and shut out the Panthers in the second half. The 49ers had two interceptions against Panthers quarterback Cam Newton.

“We had too many opportunities that we let slip through our hands, and that was the story of the day,” Newton said.

Tailback Frank Gore ran for 84 yards for the 49ers, and wide receiver Anquan Boldin had eight catches for 136 yards. Place kicker Phil Dawson provided three field goals. But the Panthers contributed heavily to their own demise, being called for three personal fouls on defense.

“It wasn’t the way we wanted it to end,” Panthers safety Mike Mitchell said. “But it is what it is. We played a very good team. We didn’t make the plays we needed to make. A couple calls didn’t go our way.”

The Panthers questioned several of the calls that went against them, including a pass interference penalty on cornerback Drayton Florence that gave the 49ers a first down at the Carolina 1-yard line shortly before Davis’s touchdown catch.

“That was a big drive, a questionable pass interference call,” Mitchell said. “I don’t know if you call that in playoff games. But it is what it is. They called it. They got another new set of downs. We couldn’t get the stop.”

On the same series, Boldin got into Mitchell’s face for an up-close-and-personal discussion after a play, with their helmets touching, and wasn’t penalized. On an earlier San Francisco field goal drive, Panthers cornerback Captain Munnerlyn was given a 15-yard penalty under similar circumstances for what was called a head-butt.

“There’s no doubt about it,” Mitchell said. “That’s what we were talking about. It was just ridiculous. A couple things just weren’t called the same way. I made a good play taking his legs out, and he gets up in my face, head-butts me, which is the same exact thing you saw Captain Munnerlyn do. [NFL Commissioner Roger] Goodell was here, too. So I’d be curious to see what he thought about that. It was the exact same play. One team gets the call. Another team doesn’t. I guess that’s human error in football.”

Davis’s one-yard touchdown catch came five seconds before halftime and put the 49ers in front 13-10. The officials originally ruled that Davis hadn’t gotten both his feet in bounds, and the play was called an incompletion. But that call was reversed via an instant-replay review. The University of Maryland product said he knew all along he had gotten both feet in bounds.

“I did,” Davis said. “That very catch, I worked on it, worked on it, worked on it this past week. And it’s definitely one of those catches that you need to work on because it was tough.”

Harbaugh was given a 15-yard unsportsmanlike conduct penalty for running on the field in protest after the original call on Davis’s catch.

“That’s the first penalty I’ve ever gotten,” Harbaugh said. “And I’m not happy about it. Dodged a bullet, though, because it didn’t cost us. I’m pleased about that. I will try to do better. Our players made it right, though.”

Boldin did his best to restrain his excitable coach.

“Anquan was telling me to stay off the field: ‘Coach, we can’t have that. Get off the field,’ ” Harbaugh said. “And he was right.”

Kaepernick ran for a four-yard touchdown in the third quarter, and Dawson kicked his third field goal midway through the fourth quarter. But Whitner said the game’s momentum shifted long before, with the two goal-line stands by the San Francisco defense.

Newton was stopped on a fourth-down quarterback sneak from the 1-yard line on the opening play of the second quarter. The Panthers held the San Francisco offense without a first down, got a 24-yard punt return by Ted Ginn Jr. and scored immediately on a 31-yard touchdown pass from Newton to wide receiver Steve Smith. But the Panthers settled for a field goal after being stopped on two plays from the 1-yard line later in the quarter.

“I do think the game turned,” Whitner said. “Those were two big stops. You expect a good running football team like that to get at least one of those in.”