Jimmy Butler got what he wanted. He’s being traded out of Miami and got a new contract in the process.

The Heat and the Golden State Warriors have agreed on a deal that sends Butler to the Bay Area, a person with knowledge of the talks said Wednesday. Butler helped carry the Heat to the NBA Finals twice, long before a hostile breakup that saw him suspended three times by the team in January.

Golden State is making it happen by moving Andrew Wiggins, Dennis Schroder, Kyle Anderson and first-round draft compensation out in the deal, said the person, who spoke to The Associated Press on condition of anonymity because the trade has not gotten league approval.

Wiggins and Anderson are headed to Miami; it’s unclear if Anderson will be staying with the Heat. Schroder is getting moved to Utah — where the Warriors, coincidentally, were Wednesday night — and Josh Richardson is heading from Miami to Detroit. Also on the move: P.J. Tucker, who was just traded to Utah and now is set to return to Miami, where he played in 2021-22.

The Heat will get a protected first-rounder from Golden State; for now, that is a pick in this year’s draft though that could change based on final terms. And ESPN reported that Butler has already agreed on a two-year extension with the Warriors, one that would be worth around $113 million.

Butler’s breakup with the Heat brewed for months. The primary issue that caused the beginning of the end of his Miami stint was money; he was eligible for a two-year, $113 million extension and the Heat never offered such a deal, largely because he’s missed about 25% of the team’s games since he arrived in 2019.

BUCKS SEND MIDDLETON TO WIZARDS FOR KUZMA: The Milwaukee Bucks are trading NBA champion and Olympic gold medalist Khris Middleton to the Washington Wizards and getting Kyle Kuzma back in the deal, a person with knowledge of the agreement told The Associated Press.

Also in the trade: A.J. Johnson goes from the Bucks to the Wizards and Patrick Baldwin goes from the Wizards to the Bucks, along with a future pick swap and some second-round draft capital, said the person, who spoke to the AP on condition of anonymity because the trade had yet to receive league approval.

The move was first reported by ESPN.

The 33-year-old Middleton, who has struggled with injuries, leaves the Bucks after spending all but one of his 13 NBA seasons in Milwaukee. The three-time All-Star has been limited to 23 games this season, 16 of those coming off the bench, but was shooting a career-best 51% in those appearances.

Middleton helped the Bucks win the NBA title in 2021, helped the United States win gold at the Tokyo Games later that year.

Milwaukee will become Kuzma’s third team after four years with the Lakers and parts of four years with the Wizards. Kuzman, 29, has averaged 17.2 point for his career, 15.2 points this season.

WIZARDS TRADE CENTER VALANCIUNAS TO KINGS: The Washington Wizards have agreed to trade center Jonas Valanciunas to the Sacramento Kings for Sidy Cissoko and two second-round draft picks, according to a person with knowledge of the deal.

The person spoke on condition of anonymity because the trade hadn’t been announced.

Valanciunas, 32, is averaging 11.5 points and 8.2 rebounds this season.

Cissoko appeared in 17 games this season, averaging 3.2 minutes.

PELICANS TRADE CENTER THEIS TO OKC FOR CASH: The New Orleans Pelicans traded center Daniel Theis and a 2031 second-round draft pick to the Western Conference-leading Oklahoma City Thunder for cash.

Theis has appeared in 38 games for New Orleans this season, averaging 4.3 points, 4.3 rebounds and 1.6 assists in 16.3 minutes per game.

BULLS GIVE BALL 2-YEAR EXTENSION: The Chicago Bulls and point guard Lonzo Ball agreed to a two-year contract extension on Wednesday, rewarding the 27-year-old after he battled back from injuries that caused him to miss two seasons.

Ball is averaging 7.2 points and 3.5 assists per game in 30 games this season after he was forced out of the previous two seasons due to multiple issues with his left knee.

RAPTORS ACQUIRE INGRAM FROM PELICANS: The Toronto Raptors are acquiring Brandon Ingram from the New Orleans Pelicans in exchange for Bruce Brown and Kelly Olynyk, a person with knowledge of the talks said.

The Raptors also will be sending a heavily protected first-round pick as well as a second-round pick to the Pelicans, said the person, who spoke to The Associated Press on condition of anonymity.

CAVALIERS 118, PISTONS 115: Darius Garland hit a 31-foot 3-pointer at the buzzer Wednesday to give visiting Cleveland a win over Detroit. The Cavaliers overcame nine points from the Pistons’ Cade Cunningham in 11 seconds.

Evan Mobley had 30 points for Cleveland and Garland added 25. Cunningham had 38 points for Detroit.