The 49ers got the full Jim Harbaugh Experience before they actually got Jim Harbaugh.

You start with hope and the adrenaline rush. You swiftly pass through stages of confusion, frustration, fear and occasional shock.

And, if everything works out right, Harbaugh eventually calls you up and signs on to be your coach. Exhale. That's what Jed York and Trent Baalke were doing Friday evening: Exhaling.

They just completed the 49ers' most anticipated hiring in decades, and they mainly looked exhausted.

Get buckled in, 49ers fans. This won't ever be boring. It probably will be successful. And you always will know who's running the show.

After 48 of the wildest hours in recent job-interview history, Harbaugh agreed to a five-year, $25 million deal to become the 49ers' new coach.

So, what was happening from the time Harbaugh left a Wednesday meeting with the 49ers until he closed the deal on Friday?

Well "... he was romanced by Miami owner Stephen Ross, negotiated with Stanford officials trying to keep him on The Farm and generated headlines and false-start reporting across all bandwidths.

In other words, this was the total Harbaugh Experience, while the 49ers sat and waited, offer on the table.

"I was learning a lot and enjoying that process," Harbaugh said after his formal news conference at a San Francisco hotel, "and I don't think anybody really knows what I was doing."

He likes it that way. He has the edge, he keeps the edge and he makes sure you know he has the edge. He does it in football strategy, and he definitely did it this week.

Mike Singletary never would have put on such a show, which speaks well for his general character but not very well for Singletary's actual coaching value.

Harbaugh was the hottest coaching commodity in years, and for the 49ers to get him, they had to play it his way.

"Obviously, it was a tough decision for Jim," Baalke, the 49ers' new general manager, said. "He had to weigh a lot of options and had to do some soul-searching. I encouraged him to take his time."

The 49ers, Baalke admitted, also had to prepare for the possibility that Harbaugh would reject their offer.

But let's try to analyze what really happened while Harbaugh went on his two-day football walk-about "...

He knew he wanted to stay in the Bay Area. He knew he wanted to be in the NFC, the opposite conference as his brother, John, coach of the Baltimore Ravens.

He knew the 49ers' roster had some talent, with a giant need for his offensive expertise and his proven ability to pick and develop a quarterback.

And Harbaugh knew he wanted, most of all, to coach in the NFL. All of that pointed to the 49ers, and Harbaugh said he knew during the meeting that the 49ers were his best option.

"That's when I knew these were the two guys that were really knowledgeable, confident, kind of cool cucumbers," Harbaugh said of York and Baalke.

He kept looking, though.

Several sources indicate that Stanford was prepared to offer Harbaugh a very large sum of money to stay with Andrew Luck for the 2011 season.

But winning at Stanford, to Harbaugh, was not like winning in the NFL.

That the 49ers also were willing to wait through the drama only underlined how much they wanted him. Bingo: Decision made.

To make sure, Harbaugh called associates. He consulted with friends. He had the options, and he explored them.

He also had an agent, David Dunn, who apparently was pushing for the 49ers all along. By the way, Dunn has a relationship with Baalke, too.

According to Baalke and York, Harbaugh called them late Thursday to say he would like to restart the talks.

They told him everybody should sleep on it, and by Friday at about 1 p.m., Harbaugh accepted the framework of the deal that was offered originally Wednesday.

No significant additional money, no additional power -- Baalke has control of the 53-man roster, which had been the domain of Singletary in past years -- but Harbaugh still is the alpha dog, and he deserves to be.

"I'm never going to say that I'm the best candidate anybody could have," Harbaugh said. "I wouldn't say that. But I'm comfortable, I'm confident."

With Miami reportedly ready to pay him $7 million a year, didn't he leave a lot of money on the table?

"I like a buck just like the next guy," Harbaugh said. "But I love coaching and I love winning and I love football "...

"Trent and Jed and the 49ers organization wanted me to be here, and I wanted to be here as much or more than they wanted me."

He's Jim Harbaugh, so he had to make sure about all that. He had the means at his disposal, and the absolute willingness to turn it into a 48-hour whirlwind.

The 49ers got him, at last. He's their whirlwind now.

Contact Tim Kawakami at tkawakami@mercurynews.com.