SANTA CLARA He's been battered, booed, screamed at by one of his head coaches and ripped in the media, but Alex Smith always has returned to the 49ers, the team that drafted him No. 1 in 2005.
And now it appears the quarterback will be back again. The NFL Network reported Tuesday that Smith had agreed to terms with the 49ers on a three-year contract believed to be worth roughly $24 million, including $10 million guaranteed.
Because Smith hasn't signed and the contract is not yet complete, the 49ers haven't officially announced the deal. But a league source confirmed the 49ers and Smith were closing in on a deal and that details likely would be finalized today.
It's exactly what everyone around the NFL was expecting, especially after coach Jim Harbaugh praised Smith throughout the 2011 season and publicly committed to him for the future, and Smith repeatedly said he wanted to be back.
But reaching a deal took a far more circuitous route than anyone imagined.
The 49ers made their offer more than two weeks ago, and it was lower than any of the multiyear deals signed by other starting quarterbacks in recent years. Smith hadn't signed by the time free agency began March 13, perhaps at the behest of his agent, Tom Condon, whose agency represents nearly half the league's starting quarterbacks.
About the same time, the 49ers got a call from another free-agent quarterback, Peyton Manning, who said he might be interested in playing for them.
That call prompted Harbaugh and offensive coordinator Greg Roman to take a cross-country flight to Durham, N.C., to watch Manning, a four-time league MVP who has had four neck surgeries in recent years, work out. With that, the 49ers officially entered the race for Manning.
Harbaugh and Roman made that trip March 13, but it wasn't until Friday that it was revealed to the public and perhaps to Smith, who had his best season in 2011, including a dramatic win over New Orleans in a divisional playoff game.
The involvement with Manning, who signed with Denver on Tuesday, prompted Smith to take his own cross-country trip to Miami, where he met with Dolphins coaches and officials Sunday and reportedly was working on a deal with the Dolphins that night.
Miami, however, agreed to a deal with quarterback David Garrard on Monday, and another team Smith was hoping to visit, Seattle, signed Matt Flynn, the backup quarterback for Aaron Rodgers in Green Bay last season.
With his options dwindling, Smith met with Harbaugh for an hour or so Monday in an effort to bridge the gap that had opened between Smith and the organization, and they spoke again Tuesday.
"Nothing's changed," Harbaugh said of his relationship with Smith while leaving the team's facility Tuesday. "It's a strong relationship, as always."
Harbaugh declined to comment on Smith's contract status.
"Based on experience, it's never wise, it never benefits anybody concerned to discuss negotiations, contracts in the media," he said.
It's unclear if Smith agrees with Harbaugh that they are as tight as they've ever been. The team's offer did not exactly mesh with Harbaugh's statements of devotion during and after the season.
While it's all but certain Smith will be the 49ers' quarterback this season, it also leaves an opening for backup Colin Kaepernick to take over before the three years are complete. Kaepernick has been a regular at the 49ers' training facility this offseason.