Former 76ers reserve power forward Ersan Ilyasova is heading back to Milwaukee.

The power forward agreed to sign a three-year, $21 million contract to return to the Bucks, according to ESPN.  The 31-year-old played his first seven seasons with the Bucks.  His wife and children still live in Milwaukee.

Ilyasova  agreed to the deal shortly after free agency began at 12:01 a.m. Sunday. He can sign his deal after 12:01 p.m. Friday when the NBA moratorium ends.

Ilyasova had two stints with the Sixers.  His second one began on April 30 after he was bought out of his contract with the Atlanta Hawks. He averaged 10.8 points and 6.7 rebounds in 23 games with the Sixers.

The Turkish player also had a lot of success with the Sixers after being acquired on Nov. 1, 2016 from the Oklahoma City Thunder, along with a 2020 first-round draft pick, for Jerami Grant. Ilyasova averaged 14.8 points and 5.9 rebounds and shot 35.9 percent on three-pointers in 53 games, including 40 starts, with the Sixers.

However, he was in the final season of his contract and wanted his next deal to be for multiple years. The Sixers were willing to only give him a one-year deal for the 2017-18 season. Unable to reach an agreement, the trade sent him to the Hawks on Feb. 22, 2017.

This season, the Sixers went 20-3 after his arrived. Ilyasova has averaged 7.8 points, 4.1 rebounds  in 108 career games with the Sixers.