Updated

The San Francisco 49ers re-signed quarterback Alex Smith to a three-year contract on Wednesday after the National Football League team was spurned by Peyton Manning.

The 49ers were believed to be one of three teams in serious contention for Manning's services but when he agreed to a deal with the Denver Broncos on Tuesday, San Francisco moved quickly to solidify their quarterbacking position by resigning Smith.

"We are pleased that Alex has chosen to continue his career as a 49er," general manager Trent Baalke in a statement.

"His contributions were instrumental to our success in 2011, and we look forward to the continued growth of our offense under his leadership."

The often-maligned Smith enjoyed a breakout campaign last season leading the 49ers to a 13-3 record, the NFC West division crown and a trip to the NFC Championship game where they lost to the eventual Super Bowl champion New York Giants.

The first overall pick in the 2005 draft, Smith started all 16 regular season games and two playoff contests last season, setting multiple career passing marks, completing 273 of 445 passes for a career-high 3,144 yards with 17 touchdowns and only five interceptions.

Despite his performance, the 49ers were in hot pursuit of Manning, leaving Smith to audition for several teams, including the Miami Dolphins.

But with Manning off the market the 49ers signed Smith to a three-year deal worth $8 million a season according to local media reports.

(Reporting by Steve Keating in Toronto; editing by Julian Linden)