Five months ago, Coach Agustin Heredia tried to calm his Estancia High boys' basketball team down in the locker room. On the road, with a bunch of rowdy teenagers, it sure wasn't easy.

The Eagles were celebrating an upset win at Indio in the first round of the CIF Southern Section Division 3A playoffs. Then the news came from their coach, and all the cheering stopped.

Heredia wasn't going to coach them in the next round.

Their coach, in dire pain, needed hip replacement surgery. The day before the second-round game, Heredia would undergo surgery to replace the hip for a second time. Telling his players that he couldn't guide them was hard for Heredia.

Heredia won't be there for the Eagles again. This time, he has decided to leave his players and the program.

Heredia said he has stepped down from his post at Estancia, where he was in charge for six seasons. He said it's time to move on and spend more time with his 12-year-old son Christian.

"I'm going to chase him around now after I've been chasing other kids around," said Heredia, whose son is entering seventh grade and will play football and basketball.

"It was hard [to leave]. I truly love Estancia and it has been good to me."

Heredia said his dream job was to coach at Estancia, his alma mater, where he was a star player before he graduated from the school in 1990. He landed the position in time for the 2007-08 season.

The other part of the dream job was to teach at Estancia, and it never materialized.

He said he went back to school in the mid-2000s to get his teaching credential for the sole purpose of pursuing his dream of teaching and coaching at Estancia. When asked whether he would've stayed on as Estancia's coach had he been a teacher on campus, Heredia, who teaches at TeWinkle Intermediate School, said, "That I don't know."

Kirk Bauermeister, the school's principal, said he talked to Heredia recently about his decision.

"Not being able to get a job on campus has been difficult for him because he wanted to be on campus, and that's been part of [his reason]," said Bauermeister, before adding that Heredia has teaching credentials for a job that hasn't opened up at Estancia. "He said it was time for him to step down and he couldn't give the program his full attention.

"He's a great basketball coach. He knows his Xs and Os, and he teaches great fundamentals. He's a good guy and the kids liked him."

Heredia, who's 42, said he would miss the daily interaction with players and the competition. The team began to compete in his first season, a year after taking over a 2-24 program.

During his six seasons at the helm of the Eagles, Heredia led them to an 83-86 overall record and 32-23 in Orange Coast League play, and to the playoffs every time. He took a leave of absence during the 2012-13 season because of personal reasons.

Last season was his first back, and Estancia placed fourth in league at 4-6, its worst finish under Heredia. In Heredia's previous five seasons, the Eagles finished second in league or shared second.

Despite the fourth-place finish in league, the Eagles earned an at-large berth into the postseason. The playoff run reached the second round for the third time under Heredia's watch. Heredia didn't get to coach Estancia (10-18 overall) at home against Whittier Pioneer because he was recovering from hip replacement surgery.

"When I set up the appointment [for the surgery], I thought we were [going to be] one-and-done [in the playoffs], but they surprised me," said Heredia, before joking that he "went out a winner."