SAN FRANCISCO -- All week, Jim Harbaugh had a good feeling about making the jump to the NFL and joining the San Francisco 49ers -- just the way mentor and late Hall of Fame coach Bill Walsh did more than 30 years ago.

Declaring it a "perfect competitive opportunity," Harbaugh accepted the job as coach of the 49ers on Friday and said his goal is to win a Lombardi Trophy for "one of the legendary franchises in all of football."

The successful Stanford coach receives a five-year, $25 million contract, league sources told ESPN NFL Insider Adam Schefter,

and gets to remain right at home in the Bay Area, moving to the NFL after four years with the Cardinal. A longtime NFL quarterback, he replaces fired coach Mike Singletary.

Harbaugh decided to leave Stanford for the pros even though San Francisco has missed the playoffs for eight straight seasons and Orange Bowl MVP quarterback Andrew Luck announced Thursday he would remain at Stanford for another season.

"I can feel the enthusiasm coursing through my veins right now," said Harbaugh, who was going to team headquarters Friday night to get to work. "I accept this competitive challenge willingly."

The 49ers pulled out all the stops to introduce him. The swanky Palace Hotel in downtown San Francisco rolled out a special red carpet for Harbaugh's arrival, and he showed up in a limousine for a news conference that began with a music video featuring team highlights.

The Cardinal (12-1) finished with a school-record 12 wins following a 40-12 victory over Virginia Tech in the Discover Orange Bowl on Monday night. It's been a whirlwind week to say the least.

Harbaugh has long admired Walsh and how he made the successful leap from Stanford to the 49ers. Harbaugh knew the man nicknamed "The Genius" for 18 years and once received footwork tips from the coach while playing for the Bears. "Everything that came out of his mind, his heart, his mouth, I hung on every single word."

Walsh thought up the original schemes that became known as the West Coast offense, which Harbaugh plans to run with the 49ers. Harbaugh has a picture of Walsh he looks at each day taped to his computer screen, but says it will be a while before any comparisons can be made of the two.

While Harbaugh said he had all but made up his mind to accept the 49ers' offer following a meeting of more than six hours that went into Wednesday evening, he took a couple of days to hear out his other suitors and do his "homework" -- and "do some soul searching" as new 49ers general manager Trent Baalke put it.

"I knew in my heart and my gut the right decision was with the San Francisco 49ers," he said.

After quite a run at Stanford, Harbaugh will head some 10 miles along the 101 freeway from Stanford to turn around a once-proud franchise that is desperate to become a contender again right away. The 49ers were expected to win the NFC West this season, then began 0-5 for their worst start since losing seven straight to begin a 2-14 season in 1979, Walsh's first year as coach.