The Phoenix Suns say the team and coach Alvin Gentry have “mutually agreed to part ways.”

Gentry had coached the Suns since replacing the fired Terry Porter at the All-Star break of the 2008-09 season, compiling a 158-144 record. His 2010 squad, led by Steve Nash, went 54-28 and advanced to the Western Conference finals.

But Nash left and the team underwent what has been a disastrous rebuilding effort. The Suns have lost 13 of 15 and four straight at home. Their 98-94 loss to Milwaukee on Thursday night snapped the Bucks’ 24-game losing streak in Phoenix.

The Suns’ 13-28 record is the worst in the Western Conference and fourth-worst in the NBA. Only Cleveland, Charlotte and Washington are worse.

The Suns said in a news release that an interim coach would be named within the next 24 to 48 hours.

Gentry, who was in the final year of his contract, has been in coaching for three decades, including stints as head coach of the Detroit Pistons, Los Angeles Clippers and Miami Heat.

He came to the Suns as an assistant to then-coach Mike D’Antoni, then stayed on the staff of new coach Terry Porter when D’Antoni left for the New York Knicks. After Porter was fired, Gentry was named interim head coach, immediately restoring the up-tempo style that D’Antoni had championed.

Phoenix, under the ownership of Robert Sarver, never recovered when power forward Amar’e Stoudemire turned down a deal to return to the Suns and left for the Knicks.

When Nash became a free agent after last season and, in a mutual decision with the Suns management, signed with the Los Angeles Lakers, Phoenix blew up its roster under the leadership of Lon Babby, vice president of basketball operations, and general manager Lance Blanks.

The rebuilt team lacked a go-to scorer and struggled with depth as Gentry continuously tried new lineups. He had said recently that the team, with the season obviously headed south, might simply turn to its younger players and look to the future.

Meanwhile, crowds at the once boisterous US Airways Center have grown meager.

The Suns don’t play again until Wednesday, when they face the Kings in Sacramento.