WALTHAM, Mass. -- Boston Celtics president of basketball operations Danny Ainge was making his way to a makeshift podium for his end-of-season news conference when his cell phone rang. Ainge politely excused himself, joking that it was his next head coach.

Only he wasn't joking. It was Doc Rivers, who had just landed back in Orlando, delivering the good news that after ironing out the final details, he and the Celtics had agreed to a five-year contract extension.

"I think Doc is the best coach in the league, so I think it's great for us, to have him around," Ainge said.

The value of the contract is $35 million over the five years, according to sources.

After the Celtics fell to the Lakers in the 2010 NBA Finals, Rivers took some time to ponder a coaching hiatus before agreeing to a one-year deal to return to the Celtics. Ainge said this current contract offer has been on the table virtually the entire time and Rivers, Ainge, and ownership held occasional conversations about a long-term agreement during this past season.

Then at the start of the postseason, with Rivers' coaching future still uncertain and the topic creating much speculation, those talks kicked into high gear.

"Doc has always known that we've wanted him and that offer was on the table," Ainge said. "I would say that, early in the playoffs, as the playoffs first started, we started that conversation again. He understood it was important for me to know what he wanted to do, because [the offseason] is a long process and there's a lot of things going on in the summer. He spent some time with his family and made his decision a little earlier this time."

Rivers said he was "leaning heavily" toward returning to the Boston bench after the Heat ended his team's season with a Game 5 win Wednesday in Miami. Rajon Rondo joked the team wasn't going to let him go back on his word after he informed the players of the same sentiment after the game.

Now, with Rivers in the fold, it appears the Celtics will have both their coach and their Big Four core of Rondo, Ray Allen, Paul Pierce and Kevin Garnett for one more run at a world title.

But Ainge is thrilled to have Rivers well beyond that as well.

"Doc wants to be here," Ainge said. "It's not all because he thinks that over the next five years we're going to have the best team in the NBA. He feels like he's part of this franchise, he likes working here, and he's willing to do whatever it takes to help us be successful."