SAN FRANCISCO — Alex Smith and the 49ers agreed to a deal Tuesday that will keep the free-agent quarterback in San Francisco, the NFL Network reported.

SAN FRANCISCO — Alex Smith and the 49ers agreed to a deal Tuesday that will keep the free-agent quarterback in San Francisco, the NFL Network reported.

According to an earlier ESPN report, which cited sources, the deal was expected to pay the former No. 1 overall pick about $8 million a season, but the length of the contract was not clear.

Smith, who led the 49ers to the NFC Championship game last season, had looked ready to sign a reported three-year, $24 million contract to remain in San Francisco, but stalled after the team emerged as a late entrant in the bidding for Peyton Manning on Friday.

Smith met with the Dolphins on Sunday and had planned to visit Seattle, but both teams found alternate quarterback options in David Garrard and Matt Flynn, respectively.

It left Smith with little option but to remain with the 49ers, which is what he was expected to do before the Manning sweepstakes began.

Manning, a four-time MVP, was introduced as the new quarterback of the Denver Broncos on Tuesday after agreeing to a five-year, $96 million deal.