Once thought a first-pick bust for the 49ers, the quarterback now rates a standing ovation when tossing out the first pitch at a S.F. Giants playoff game.

It came last Saturday before Game 1 of the National League division series between the San Francisco Giants and Cincinnati Reds, when Smith had the honor of throwing out the first pitch.

Who could have guessed that Smith, once the Bay Area's most derided athlete, would get those raucous cheers as he walked out to the mound? This was a guy who went from the NFL's No. 1 pick, to a struggling starter, to a backup, to nearly being cast aside by the franchise that had rushed him onto the field.

Now, as a leader of the hottest team in football and owner of a league-best 108.7 passer rating, he's embraced by a fan base that once roundly rejected him.

So it was really no big deal that he threw that ceremonial pitch into the dirt in front of home plate, even though he joked: "I'm disgusted with myself."

No matter, no one questions his accuracy anymore, not with him competing 68.6% of his passes with eight touchdowns and only one interception. Smith, whose team will play host to the New York Giants on Sunday in a rematch of last season's NFC championship game, has thoroughly reinvented himself.

And he has done it in a unique way. Unlike quarterbacks such as Jim Plunkett, Steve Young and Rich Gannon, who had career breakthroughs after changing teams, Smith has been able to survive the worst of times with the 49ers — times when coaches have flat given up on him — to emerge on the other side.

Coach Jim Harbaugh has played an essential role in the transformation, casting his lot with Smith from the start, something previous coaches Mike Nolan and Mike Singletary didn't do.

"Can't tell you how much respect I have for him," Harbaugh said. "That he has played well, handles himself, does all the things. [I] kind of look back and say, 'Man, I wish I would have done as good a job as he has done.' On and off the field, in everything that he does and his approach to the game, I think it's a real example."

That confidence paid off last season when Smith — who had cycled through a constant carousel of different offensive coordinators and quarterback coaches — clicked with Harbaugh and offensive coordinator Greg Roman. They put their faith in Smith and he delivered, with 17 touchdowns and just five interceptions, helping carry the club to within one win of the Super Bowl.

There's no magic to the emergence of Smith. He has a better head coach — a former NFL quarterback who had his own ups and downs; better personnel around him on both sides of the ball; is healthier after undergoing several shoulder surgeries, and is simply older and more experienced. It's easy to forget that Smith is only 28, younger even than Brandon Weeden, Cleveland's rookie quarterback.

In the darkest times, could Smith have envisioned being in the position the 49ers are now in, as an elite team with him at the helm?

"I was certainly playing for it. I wasn't playing to continue to lose," he said, standing at his locker this week. "You continue to put the work in and to fight and play because you're trying to win games. No question, thought it could get better, didn't know when or how."

Smith, in his seventh season, is one of just two No. 1 picks in the modern era to spend more than five seasons with his original team despite never making a Pro Bowl. The other is defensive end Kenneth Sims, the top pick in 1982, who played eight seasons with New England.

The 49ers have stood by Smith, even though they came close to tossing him aside several times.

Nolan pressed him into action with a bad supporting cast almost immediately, then got frustrated with him for not developing quickly enough. The coach publicly questioned his toughness, wondering why he wouldn't play through a separated shoulder that would require several surgeries.

Singletary never trusted Smith's ability to throw, and instead ran a simple, run-oriented offense. He once referred to Smith as "meek," a comment that wasn't malicious but was less than a ringing endorsement of the quarterback's leadership skills.

Said Jed York, 49ers chief executive, of Smith: "We had to look at it and say, 'We have somebody here that knows the team, knows the offense, knows the system. We just haven't done a good enough job of putting him in a stable situation where he can be successful.' A lot of that are failures I would put on the organization, not Alex."

Harbaugh was hired in January 2011, a few months before the lockout. He soon announced that Smith was his quarterback, even though there was widespread speculation that the 49ers might sign Matt Hasselbeck. Then came the lockout, and that helped Smith in at least two significant ways:

First, with no free-agency period (until one ultimately came in late July), the 49ers couldn't sign another veteran quarterback, even if they wanted to, and no other teams could make a play for Smith.