BOSTON — The Celtics are working on a deal with Coach Doc Rivers that would bring him back for another run at an NBA title with Boston’s aging Big Three – and then keep him on the bench to work with the rebuilt roster that is expected to follow.

The sides are nearing agreement on a deal for “more than two or three years,” a person with knowledge of the negotiations said, speaking on the condition of anonymity because the details were still being worked out.

A Celtics spokesman, Jeff Twiss, confirmed a deal was being discussed but said no announcement was imminent, and General Manager Danny Ainge said on the radio that the sides were working on a long-term deal. Neither Rivers nor his agent, Lonnie Cooper, responded to messages seeking comment.

But Rivers, whose contract expires at the end of this season, told players after being eliminated from the playoffs Wednesday night that he would return.

“I’m going to put this on the record,” point guard Rajon Rondo said after the 97-87 loss to Miami eliminated the Celtics from the postseason. “Doc already committed that he was coming back with me so he can’t go back against his word.”

Rivers’ commitment is the biggest indication Ainge will keep the core of the team that won the 2008 title and returned to the NBA finals in 2010, losing in seven games to the Lakers.

That was good news for the players.

“If we’re moving forward next year and trying to win a championship, he’s one of the main pieces,” said the captain, Paul Pierce.

But it’s not just for one last run with the Big Three. A long-term deal would mean that Rivers, who last summer considered leaving to spend more time with his family, was committed to rebuild the roster when Kevin Garnett and Ray Allen – and perhaps Pierce as well – retire.

Pierce, a career Celtic, is signed for three more years; he will turn 34 before the 2011-12 opener.

Garnett, who turns 35 next week, has one more year on his deal. And Allen will turn 36 this summer, then enter the final year of his contract.

“This has been my team,” Allen said. “I have been full steam ahead with this team. I don’t have any plans to go anywhere else.”

Rivers has been rumored for vacancies across the league, including the Los Angeles Lakers. Although last summer, he mulled whether to take time off and spend time with his family, he said immediately after Wednesday night’s game that he was “leaning heavily to coming back.”

“I haven’t made that decision, but I can tell you I probably will,” he said. “I’m a Celtic and I love our guys. I want to win again here and I’m competitive as hell. I have a competitive group so we’ll see. I can tell you that is where I am at today. Tomorrow, I may change my mind. But that’s where I am at today.”

Pierce expects changes to the roster.

“I know it’s going to look different. I know that for a fact,” Pierce said. “I don’t know what, but we’ll have to wait and see.”