FILE - In this May 12, 2017, file photo, Boston Celtics guard Avery Bradley (0) shoots in front of Washington Wizards guard Bradley Beal (3) during the second half of Game 6 of an NBA basketball second-round playoff series, in Washington.  A person with knowledge of the deal tells The Associated Press that the Detroit Pistons have acquired guard Avery Bradley from the Boston Celtics for forward Marcus Morris.Detroit also receives a 2019 second-round draft pick, according to the person who spoke on condition of anonymity Friday, July 7, 2017, because the trade had not been announced.
FILE - In this May 12, 2017, file photo, Boston Celtics guard Avery Bradley (0) shoots in front of Washington Wizards guard Bradley Beal (3) during the second half of Game 6 of an NBA basketball second-round playoff series, in Washington. A person with knowledge of the deal tells The Associated Press that the Detroit Pistons have acquired guard Avery Bradley from the Boston Celtics for forward Marcus Morris.Detroit also receives a 2019 second-round draft pick, according to the person who spoke on condition of anonymity Friday, July 7, 2017, because the trade had not been announced. Credit: AP

DETROIT — After agreeing to a deal with free agent Gordon Hayward, the Celtics were forced to make a move to get under the salary cap.

On Friday they traded guard Avery Bradley along with a second round draft pick in 2019 for to the Detroit Pistons for forward Marcus Morris.

Bradley’s arrival gives the Pistons a replacement for Kentavious Caldwell-Pope, who had been a restricted free agent. Detroit has now renounced the rights to Caldwell-Pope.

Bradley averaged 16.3 points per game last season for the Celtics. Morris averaged 14 points for Detroit.

Celtics president of basketball operations Danny Ainge released a statement thanking Bradley for his contributions.

“It’s no secret that Avery had been one of my favorite players,” Ainge said. “Avery did a lot of the dirty work and often didn’t get the recognition that he deserved, but our coaches, staff, his teammates, and our fans who watched him play every night appreciated what a special player and person he is.”

Bradley was the longest-tenured member of the Celtics, bridging the gap from the era of Paul Pierce, Kevin Garnett and Ray Allen that won the 2008 NBA title. Picked 19th overall in the 2010 draft, he developed into one of the league’s best defenders, making the All-Defensive second team in 2013 and first team in 2016.

Boston will look different from the team that was the top seed in the East in 2017 before being routed in the conference finals by Cleveland. Landing Hayward was a big step, and the Celtics took Duke’s Jayson Tatum with the No. 3 pick in the draft after trading down from No. 1. With Jaylen Brown — last year’s No. 3 pick — also in the fold, the Celtics look primed to contend for years to come, although the roster could keep changing.

Isaiah Thomas averaged 28.9 points last season, and Al Horford, Jae Crowder and Marcus Smart were all in double figures as well. Boston has plenty of bargaining chips it can use in future moves — the Celtics have been stockpiling first-round picks — and it will be up to Ainge to come up with the right mix.

Detroit, which missed the playoffs last year, can slot Bradley into the backcourt alongside point guard Reggie Jackson. Bradley, who turns 27 in November, is older than the 24-year-old Caldwell-Pope, but he’s also been a better shooter from 3-point range, finishing at 39 percent last season.

The Pistons lose Morris, who has been a steady veteran and a mainstay in the starting lineup over the past two seasons. Detroit has another solid wing player in Tobias Harris, and the Pistons drafted sharp-shooting Duke guard Luke Kennard in the first round.

Bradley is entering the final season of a four-year contract, so it’s not clear if he can be a long-term solution for Detroit. The Pistons went 37-45 last season, a disappointing mark for a team that was in the postseason in 2016. Much of the attention this offseason has centered on Jackson and big man Andre Drummond, since Detroit could use more production from that point guard-center tandem. Bradley now brings some extra scoring punch — he averaged more points than any Pistons player last season.

Caldwell-Pope averaged 13.8 points, and his athleticism made him an asset on defense, but he shot only 40 percent from the field in 2016-17, and his career rate is about the same.